From 306ec6c3cece7004429c79c1ac93d49919f1f1cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Tue, 30 Jul 2013 03:50:44 +0200 Subject: virtio: Convert exit to unrealize MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andreas Färber Signed-off-by: Paolo Bonzini --- hw/scsi/vhost-scsi.c | 11 ++++++----- hw/scsi/virtio-scsi.c | 17 +++++++++-------- 2 files changed, 15 insertions(+), 13 deletions(-) (limited to 'hw/scsi') diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c index 1f1c9f3..3983a5b 100644 --- a/hw/scsi/vhost-scsi.c +++ b/hw/scsi/vhost-scsi.c @@ -240,10 +240,10 @@ static void vhost_scsi_realize(DeviceState *dev, Error **errp) migrate_add_blocker(s->migration_blocker); } -static void vhost_scsi_exit(VirtIODevice *vdev) +static void vhost_scsi_unrealize(DeviceState *dev, Error **errp) { - VHostSCSI *s = VHOST_SCSI(vdev); - VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(vdev); + VirtIODevice *vdev = VIRTIO_DEVICE(dev); + VHostSCSI *s = VHOST_SCSI(dev); migrate_del_blocker(s->migration_blocker); error_free(s->migration_blocker); @@ -252,7 +252,8 @@ static void vhost_scsi_exit(VirtIODevice *vdev) vhost_scsi_set_status(vdev, 0); g_free(s->dev.vqs); - virtio_scsi_common_exit(vs); + + virtio_scsi_common_unrealize(dev, errp); } static Property vhost_scsi_properties[] = { @@ -268,7 +269,7 @@ static void vhost_scsi_class_init(ObjectClass *klass, void *data) dc->props = vhost_scsi_properties; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); vdc->realize = vhost_scsi_realize; - vdc->exit = vhost_scsi_exit; + vdc->unrealize = vhost_scsi_unrealize; vdc->get_features = vhost_scsi_get_features; vdc->set_config = vhost_scsi_set_config; vdc->set_status = vhost_scsi_set_status; diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index a208cf3..6dcdd1b 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; -- cgit v1.1