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:
Andreas Färber 2013-07-30 04:05:02 +02:00 committed by Paolo Bonzini
parent 71a6520b83
commit 0ba94b6f94
3 changed files with 4 additions and 10 deletions

View file

@ -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);
}