virtio: Start converting VirtioDevice to QOM realize

Temporarily allow either VirtioDeviceClass::init or
VirtioDeviceClass::realize.

Introduce VirtioDeviceClass::unrealize for symmetry.

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 00:50:27 +02:00 committed by Paolo Bonzini
parent 7598f0f30e
commit 1d244b42d2
2 changed files with 29 additions and 15 deletions

View file

@ -124,10 +124,12 @@ struct VirtIODevice
};
typedef struct VirtioDeviceClass {
/* This is what a VirtioDevice must implement */
DeviceClass parent;
/* This is what a VirtioDevice must implement */
int (*init)(VirtIODevice *vdev);
void (*exit)(VirtIODevice *vdev);
DeviceRealize realize;
uint32_t (*get_features)(VirtIODevice *vdev, uint32_t requested_features);
uint32_t (*bad_features)(VirtIODevice *vdev);
void (*set_features)(VirtIODevice *vdev, uint32_t val);