summaryrefslogtreecommitdiffstats
path: root/hw/virtio/virtio.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-07-30 03:50:44 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2013-12-09 21:46:49 +0100
commit306ec6c3cece7004429c79c1ac93d49919f1f1cc (patch)
treedbd5a39523f0ee96d77f235c12e6dcd7de5426a6 /hw/virtio/virtio.c
parent0ba94b6f94a5b0bed9f125ce4c3348adc83db5de (diff)
downloadhqemu-306ec6c3cece7004429c79c1ac93d49919f1f1cc.zip
hqemu-306ec6c3cece7004429c79c1ac93d49919f1f1cc.tar.gz
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/virtio/virtio.c')
-rw-r--r--hw/virtio/virtio.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 1dba284..144b9ca 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -1169,12 +1169,15 @@ static void virtio_device_realize(DeviceState *dev, Error **errp)
static void virtio_device_unrealize(DeviceState *dev, Error **errp)
{
VirtIODevice *vdev = VIRTIO_DEVICE(dev);
- VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(dev);
-
- virtio_bus_device_unplugged(vdev);
+ VirtioDeviceClass *vdc = VIRTIO_DEVICE_GET_CLASS(dev);
+ Error *err = NULL;
- if (k->exit != NULL) {
- k->exit(vdev);
+ if (vdc->unrealize != NULL) {
+ vdc->unrealize(dev, &err);
+ if (err != NULL) {
+ error_propagate(errp, err);
+ return;
+ }
}
if (vdev->bus_name) {
OpenPOWER on IntegriCloud