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/grackle_pci.c | |
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/grackle_pci.c')
-rw-r--r-- | hw/grackle_pci.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/hw/grackle_pci.c b/hw/grackle_pci.c index a790f979e6..549859ddcd 100644 --- a/hw/grackle_pci.c +++ b/hw/grackle_pci.c @@ -139,16 +139,23 @@ static DeviceInfo grackle_pci_info = { .class_init = grackle_pci_class_init, }; -static SysBusDeviceInfo grackle_pci_host_info = { - .qdev.name = "grackle-pcihost", - .qdev.size = sizeof(GrackleState), - .qdev.no_user = 1, - .init = pci_grackle_init_device, +static void pci_grackle_class_init(ObjectClass *klass, void *data) +{ + SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); + + k->init = pci_grackle_init_device; +} + +static DeviceInfo grackle_pci_host_info = { + .name = "grackle-pcihost", + .size = sizeof(GrackleState), + .no_user = 1, + .class_init = pci_grackle_class_init, }; static void grackle_register_devices(void) { - sysbus_register_withprop(&grackle_pci_host_info); + sysbus_qdev_register(&grackle_pci_host_info); pci_qdev_register(&grackle_pci_info); } |