virtio: Convert exit to unrealize

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Andreas Färber 2013-07-30 03:50:44 +02:00 committed by Paolo Bonzini
parent 0ba94b6f94
commit 306ec6c3ce
10 changed files with 51 additions and 40 deletions

View file

@ -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);
VirtioDeviceClass *vdc = VIRTIO_DEVICE_GET_CLASS(dev);
Error *err = NULL;
virtio_bus_device_unplugged(vdev);
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) {