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 /hw/virtio.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 'hw/virtio.c')
-rw-r--r-- | hw/virtio.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/hw/virtio.c b/hw/virtio.c index 93dfb1e359..13aa0faf27 100644 --- a/hw/virtio.c +++ b/hw/virtio.c @@ -832,9 +832,9 @@ void virtio_cleanup(VirtIODevice *vdev) { qemu_del_vm_change_state_handler(vdev->vmstate); if (vdev->config) - qemu_free(vdev->config); - qemu_free(vdev->vq); - qemu_free(vdev); + g_free(vdev->config); + g_free(vdev->vq); + g_free(vdev); } static void virtio_vmstate_change(void *opaque, int running, int reason) @@ -862,14 +862,14 @@ VirtIODevice *virtio_common_init(const char *name, uint16_t device_id, VirtIODevice *vdev; int i; - vdev = qemu_mallocz(struct_size); + vdev = g_malloc0(struct_size); vdev->device_id = device_id; vdev->status = 0; vdev->isr = 0; vdev->queue_sel = 0; vdev->config_vector = VIRTIO_NO_VECTOR; - vdev->vq = qemu_mallocz(sizeof(VirtQueue) * VIRTIO_PCI_QUEUE_MAX); + vdev->vq = g_malloc0(sizeof(VirtQueue) * VIRTIO_PCI_QUEUE_MAX); vdev->vm_running = vm_running; for(i = 0; i < VIRTIO_PCI_QUEUE_MAX; i++) { vdev->vq[i].vector = VIRTIO_NO_VECTOR; @@ -879,7 +879,7 @@ VirtIODevice *virtio_common_init(const char *name, uint16_t device_id, vdev->name = name; vdev->config_len = config_size; if (vdev->config_len) - vdev->config = qemu_mallocz(config_size); + vdev->config = g_malloc0(config_size); else vdev->config = NULL; |