diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2012-01-24 13:12:29 -0600 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-01-27 10:50:50 -0600 |
commit | 999e12bbe85c5dcf49bef13bce4f97399c7105f4 (patch) | |
tree | 73b6ed8633a73134e9f728baa1ed2b1dab58b5b0 /hw/ide | |
parent | 40021f08882aaef93c66c8c740087b6d3031b63a (diff) |
sysbus: apic: ioapic: convert to QEMU Object Model
This converts three devices because apic and ioapic are subclasses of sysbus.
Converting subclasses independently of their base class is prohibitively hard.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/ide')
-rw-r--r-- | hw/ide/ahci.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 0309dd65b0..8869fd6b42 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -1239,22 +1239,27 @@ static int sysbus_ahci_init(SysBusDevice *dev) return 0; } -static SysBusDeviceInfo sysbus_ahci_info = { - .qdev.name = "sysbus-ahci", - .qdev.size = sizeof(SysbusAHCIState), - .qdev.vmsd = &vmstate_sysbus_ahci, - .qdev.props = (Property[]) { +static void sysbus_ahci_class_init(ObjectClass *klass, void *data) +{ + SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(klass); + + sbc->init = sysbus_ahci_init; +} + +static DeviceInfo sysbus_ahci_info = { + .name = "sysbus-ahci", + .size = sizeof(SysbusAHCIState), + .vmsd = &vmstate_sysbus_ahci, + .class_init = sysbus_ahci_class_init, + .props = (Property[]) { DEFINE_PROP_UINT32("num-ports", SysbusAHCIState, num_ports, 1), DEFINE_PROP_END_OF_LIST(), }, - .init = sysbus_ahci_init, - - }; static void sysbus_ahci_register(void) { - sysbus_register_withprop(&sysbus_ahci_info); + sysbus_qdev_register(&sysbus_ahci_info); } device_init(sysbus_ahci_register); |