mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
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:
parent
0ba94b6f94
commit
306ec6c3ce
10 changed files with 51 additions and 40 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue