mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
virtio: Complete converting VirtioDevice to QOM realize
Drop VirtioDeviceClass::init. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
71a6520b83
commit
0ba94b6f94
3 changed files with 4 additions and 10 deletions
|
@ -1156,18 +1156,12 @@ static void virtio_device_realize(DeviceState *dev, Error **errp)
|
|||
VirtioDeviceClass *vdc = VIRTIO_DEVICE_GET_CLASS(dev);
|
||||
Error *err = NULL;
|
||||
|
||||
assert(vdc->init != NULL || vdc->realize != NULL);
|
||||
if (vdc->realize != NULL) {
|
||||
vdc->realize(dev, &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (vdc->init(vdev) < 0) {
|
||||
error_setg(errp, "Device initialization failed.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
virtio_bus_device_plugged(vdev);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue