summaryrefslogtreecommitdiffstats
path: root/hw/scsi/virtio-scsi.c
diff options
context:
space:
mode:
authorAndreas Färber2013-07-30 03:50:44 +0200
committerPaolo Bonzini2013-12-09 21:46:49 +0100
commit306ec6c3cece7004429c79c1ac93d49919f1f1cc (patch)
treedbd5a39523f0ee96d77f235c12e6dcd7de5426a6 /hw/scsi/virtio-scsi.c
parentvirtio: Complete converting VirtioDevice to QOM realize (diff)
downloadqemu-306ec6c3cece7004429c79c1ac93d49919f1f1cc.tar.gz
qemu-306ec6c3cece7004429c79c1ac93d49919f1f1cc.tar.xz
qemu-306ec6c3cece7004429c79c1ac93d49919f1f1cc.zip
virtio: Convert exit to unrealize
Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/scsi/virtio-scsi.c')
-rw-r--r--hw/scsi/virtio-scsi.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
index a208cf3d89..6dcdd1b91c 100644
--- a/hw/scsi/virtio-scsi.c
+++ b/hw/scsi/virtio-scsi.c
@@ -640,21 +640,22 @@ static void virtio_scsi_device_realize(DeviceState *dev, Error **errp)
virtio_scsi_save, virtio_scsi_load, s);
}
-void virtio_scsi_common_exit(VirtIOSCSICommon *vs)
+void virtio_scsi_common_unrealize(DeviceState *dev, Error **errp)
{
- VirtIODevice *vdev = VIRTIO_DEVICE(vs);
+ VirtIODevice *vdev = VIRTIO_DEVICE(dev);
+ VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(dev);
g_free(vs->cmd_vqs);
virtio_cleanup(vdev);
}
-static void virtio_scsi_device_exit(VirtIODevice *vdev)
+static void virtio_scsi_device_unrealize(DeviceState *dev, Error **errp)
{
- VirtIOSCSI *s = VIRTIO_SCSI(vdev);
- VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(vdev);
+ VirtIOSCSI *s = VIRTIO_SCSI(dev);
+
+ unregister_savevm(dev, "virtio-scsi", s);
- unregister_savevm(DEVICE(vdev), "virtio-scsi", s);
- virtio_scsi_common_exit(vs);
+ virtio_scsi_common_unrealize(dev, errp);
}
static Property virtio_scsi_properties[] = {
@@ -679,7 +680,7 @@ static void virtio_scsi_class_init(ObjectClass *klass, void *data)
dc->props = virtio_scsi_properties;
set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
vdc->realize = virtio_scsi_device_realize;
- vdc->exit = virtio_scsi_device_exit;
+ vdc->unrealize = virtio_scsi_device_unrealize;
vdc->set_config = virtio_scsi_set_config;
vdc->get_features = virtio_scsi_get_features;
vdc->reset = virtio_scsi_reset;