diff options
Diffstat (limited to 'hw')
-rw-r--r-- | hw/block/virtio-blk.c | 4 | ||||
-rw-r--r-- | hw/char/virtio-serial-bus.c | 2 | ||||
-rw-r--r-- | hw/net/virtio-net.c | 2 | ||||
-rw-r--r-- | hw/scsi/virtio-scsi.c | 2 | ||||
-rw-r--r-- | hw/virtio/virtio-balloon.c | 4 | ||||
-rw-r--r-- | hw/virtio/virtio-rng.c | 2 | ||||
-rw-r--r-- | hw/virtio/virtio.c | 17 |
7 files changed, 9 insertions, 24 deletions
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index efad690..cf12469 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c @@ -661,7 +661,7 @@ static int virtio_blk_device_init(VirtIODevice *vdev) s->vq = virtio_add_queue(vdev, 128, virtio_blk_handle_output); #ifdef CONFIG_VIRTIO_BLK_DATA_PLANE if (!virtio_blk_data_plane_create(vdev, blk, &s->dataplane)) { - virtio_common_cleanup(vdev); + virtio_cleanup(vdev); return -1; } #endif @@ -689,7 +689,7 @@ static int virtio_blk_device_exit(DeviceState *dev) qemu_del_vm_change_state_handler(s->change); unregister_savevm(dev, "virtio-blk", s); blockdev_mark_auto_del(s->bs); - virtio_common_cleanup(vdev); + virtio_cleanup(vdev); return 0; } diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c index 6a5b8b6..3787ad2 100644 --- a/hw/char/virtio-serial-bus.c +++ b/hw/char/virtio-serial-bus.c @@ -1001,7 +1001,7 @@ static int virtio_serial_device_exit(DeviceState *dev) qemu_free_timer(vser->post_load->timer); g_free(vser->post_load); } - virtio_common_cleanup(vdev); + virtio_cleanup(vdev); return 0; } diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 0a0d516..2aea5a1 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -1374,7 +1374,7 @@ static int virtio_net_device_exit(DeviceState *qdev) g_free(n->vqs); qemu_del_nic(n->nic); - virtio_common_cleanup(vdev); + virtio_cleanup(vdev); return 0; } diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index 630e459..84b3ac7 100644 --- a/hw/scsi/virtio-scsi.c +++ b/hw/scsi/virtio-scsi.c @@ -640,7 +640,7 @@ int virtio_scsi_common_exit(VirtIOSCSICommon *vs) VirtIODevice *vdev = VIRTIO_DEVICE(vs); g_free(vs->cmd_vqs); - virtio_common_cleanup(vdev); + virtio_cleanup(vdev); return 0; } diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 95fb3b0..d669756 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -348,7 +348,7 @@ static int virtio_balloon_device_init(VirtIODevice *vdev) virtio_balloon_stat, s); if (ret < 0) { - virtio_common_cleanup(VIRTIO_DEVICE(s)); + virtio_cleanup(VIRTIO_DEVICE(s)); return -1; } @@ -377,7 +377,7 @@ static int virtio_balloon_device_exit(DeviceState *qdev) balloon_stats_destroy_timer(s); qemu_remove_balloon_handler(s); unregister_savevm(qdev, "virtio-balloon", s); - virtio_common_cleanup(vdev); + virtio_cleanup(vdev); return 0; } diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c index 82d7a74..cb787c7 100644 --- a/hw/virtio/virtio-rng.c +++ b/hw/virtio/virtio-rng.c @@ -192,7 +192,7 @@ static int virtio_rng_device_exit(DeviceState *qdev) qemu_del_timer(vrng->rate_limit_timer); qemu_free_timer(vrng->rate_limit_timer); unregister_savevm(qdev, "virtio-rng", vrng); - virtio_common_cleanup(vdev); + virtio_cleanup(vdev); return 0; } diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index e66dab1..0f88c25 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -910,19 +910,13 @@ int virtio_load(VirtIODevice *vdev, QEMUFile *f) return 0; } -void virtio_common_cleanup(VirtIODevice *vdev) +void virtio_cleanup(VirtIODevice *vdev) { qemu_del_vm_change_state_handler(vdev->vmstate); g_free(vdev->config); g_free(vdev->vq); } -void virtio_cleanup(VirtIODevice *vdev) -{ - virtio_common_cleanup(vdev); - g_free(vdev); -} - static void virtio_vmstate_change(void *opaque, int running, RunState state) { VirtIODevice *vdev = opaque; @@ -972,15 +966,6 @@ void virtio_init(VirtIODevice *vdev, const char *name, vdev); } -VirtIODevice *virtio_common_init(const char *name, uint16_t device_id, - size_t config_size, size_t struct_size) -{ - VirtIODevice *vdev; - vdev = g_malloc0(struct_size); - virtio_init(vdev, name, device_id, config_size); - return vdev; -} - hwaddr virtio_queue_get_desc_addr(VirtIODevice *vdev, int n) { return vdev->vq[n].vring.desc; |