From 7267c0947d7e8ae5dff7bafd932c3bc285f43e5c Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Sat, 20 Aug 2011 22:09:37 -0500 Subject: Use glib memory allocation and free functions qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori --- hw/9pfs/virtio-9p-device.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'hw/9pfs/virtio-9p-device.c') diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c index f4bf471..9466002 100644 --- a/hw/9pfs/virtio-9p-device.c +++ b/hw/9pfs/virtio-9p-device.c @@ -36,12 +36,12 @@ static void virtio_9p_get_config(VirtIODevice *vdev, uint8_t *config) struct virtio_9p_config *cfg; V9fsState *s = to_virtio_9p(vdev); - cfg = qemu_mallocz(sizeof(struct virtio_9p_config) + + cfg = g_malloc0(sizeof(struct virtio_9p_config) + s->tag_len); stw_raw(&cfg->tag_len, s->tag_len); memcpy(cfg->tag, s->tag, s->tag_len); memcpy(config, cfg, s->config_size); - qemu_free(cfg); + g_free(cfg); } VirtIODevice *virtio_9p_init(DeviceState *dev, V9fsConf *conf) @@ -114,13 +114,13 @@ VirtIODevice *virtio_9p_init(DeviceState *dev, V9fsConf *conf) exit(1); } - s->ctx.fs_root = qemu_strdup(fse->path); + s->ctx.fs_root = g_strdup(fse->path); len = strlen(conf->tag); if (len > MAX_TAG_LEN) { len = MAX_TAG_LEN; } /* s->tag is non-NULL terminated string */ - s->tag = qemu_malloc(len); + s->tag = g_malloc(len); memcpy(s->tag, conf->tag, len); s->tag_len = len; s->ctx.uid = -1; -- cgit v1.1