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/slavio_misc.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/slavio_misc.c')
-rw-r--r-- | hw/slavio_misc.c | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/hw/slavio_misc.c b/hw/slavio_misc.c index 484301c48a..39a5269c8e 100644 --- a/hw/slavio_misc.c +++ b/hw/slavio_misc.c @@ -468,18 +468,32 @@ static int slavio_misc_init1(SysBusDevice *dev) return 0; } -static SysBusDeviceInfo slavio_misc_info = { - .init = slavio_misc_init1, - .qdev.name = "slavio_misc", - .qdev.size = sizeof(MiscState), - .qdev.vmsd = &vmstate_misc, - .qdev.reset = slavio_misc_reset, +static void slavio_misc_class_init(ObjectClass *klass, void *data) +{ + SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); + + k->init = slavio_misc_init1; +} + +static DeviceInfo slavio_misc_info = { + .name = "slavio_misc", + .size = sizeof(MiscState), + .vmsd = &vmstate_misc, + .reset = slavio_misc_reset, + .class_init = slavio_misc_class_init, }; -static SysBusDeviceInfo apc_info = { - .init = apc_init1, - .qdev.name = "apc", - .qdev.size = sizeof(MiscState), +static void apc_class_init(ObjectClass *klass, void *data) +{ + SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); + + k->init = apc_init1; +} + +static DeviceInfo apc_info = { + .name = "apc", + .size = sizeof(MiscState), + .class_init = apc_class_init, }; static void slavio_misc_register_devices(void) |