isa: pic: convert to QEMU Object Model
This converts two devices at once because PIC subclasses ISA and converting
subclasses independently is extremely hard.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
diff --git a/hw/vmport.c b/hw/vmport.c
index 0a3dbc5..c4582d6 100644
--- a/hw/vmport.c
+++ b/hw/vmport.c
@@ -144,11 +144,17 @@
return 0;
}
-static ISADeviceInfo vmport_info = {
- .qdev.name = "vmport",
- .qdev.size = sizeof(VMPortState),
- .qdev.no_user = 1,
- .init = vmport_initfn,
+static void vmport_class_initfn(ObjectClass *klass, void *data)
+{
+ ISADeviceClass *ic = ISA_DEVICE_CLASS(klass);
+ ic->init = vmport_initfn;
+}
+
+static DeviceInfo vmport_info = {
+ .name = "vmport",
+ .size = sizeof(VMPortState),
+ .no_user = 1,
+ .class_init = vmport_class_initfn,
};
static void vmport_dev_register(void)