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/lan9118.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/lan9118.c')
-rw-r--r-- | hw/lan9118.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/hw/lan9118.c b/hw/lan9118.c index 93e1896b70..3925b0469f 100644 --- a/hw/lan9118.c +++ b/hw/lan9118.c @@ -1238,16 +1238,25 @@ static int lan9118_init1(SysBusDevice *dev) return 0; } -static SysBusDeviceInfo lan9118_info = { - .init = lan9118_init1, - .qdev.name = "lan9118", - .qdev.size = sizeof(lan9118_state), - .qdev.reset = lan9118_reset, - .qdev.vmsd = &vmstate_lan9118, - .qdev.props = (Property[]) { - DEFINE_NIC_PROPERTIES(lan9118_state, conf), - DEFINE_PROP_END_OF_LIST(), - } +static Property lan9118_properties[] = { + DEFINE_NIC_PROPERTIES(lan9118_state, conf), + DEFINE_PROP_END_OF_LIST(), +}; + +static void lan9118_class_init(ObjectClass *klass, void *data) +{ + SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); + + k->init = lan9118_init1; +} + +static DeviceInfo lan9118_info = { + .name = "lan9118", + .size = sizeof(lan9118_state), + .reset = lan9118_reset, + .vmsd = &vmstate_lan9118, + .props = lan9118_properties, + .class_init = lan9118_class_init, }; static void lan9118_register_devices(void) |