diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2011-08-20 22:09:37 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2011-08-20 23:01:08 -0500 |
commit | 7267c0947d7e8ae5dff7bafd932c3bc285f43e5c (patch) | |
tree | 9aa05d6e05ed83e67bf014f6745a3081b8407dc5 /spice-qemu-char.c | |
parent | 14015304b662e8f8ccce46c5a6927af6a14c510b (diff) |
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'spice-qemu-char.c')
-rw-r--r-- | spice-qemu-char.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/spice-qemu-char.c b/spice-qemu-char.c index 95bf6b65d1..684024bf57 100644 --- a/spice-qemu-char.c +++ b/spice-qemu-char.c @@ -112,7 +112,7 @@ static int spice_chr_write(CharDriverState *chr, const uint8_t *buf, int len) assert(s->datalen == 0); if (s->bufsize < len) { s->bufsize = len; - s->buffer = qemu_realloc(s->buffer, s->bufsize); + s->buffer = g_realloc(s->buffer, s->bufsize); } memcpy(s->buffer, buf, len); s->datapos = s->buffer; @@ -127,7 +127,7 @@ static void spice_chr_close(struct CharDriverState *chr) printf("%s\n", __func__); vmc_unregister_interface(s); - qemu_free(s); + g_free(s); } static void spice_chr_guest_open(struct CharDriverState *chr) @@ -185,8 +185,8 @@ int qemu_chr_open_spice(QemuOpts *opts, CharDriverState **_chr) return -EINVAL; } - chr = qemu_mallocz(sizeof(CharDriverState)); - s = qemu_mallocz(sizeof(SpiceCharDriver)); + chr = g_malloc0(sizeof(CharDriverState)); + s = g_malloc0(sizeof(SpiceCharDriver)); s->chr = chr; s->debug = debug; s->active = false; |