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/lance.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/lance.c')
-rw-r--r-- | hw/lance.c | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/hw/lance.c b/hw/lance.c index 716470061c..969d766ae4 100644 --- a/hw/lance.c +++ b/hw/lance.c @@ -137,18 +137,27 @@ static void lance_reset(DeviceState *dev) pcnet_h_reset(&d->state); } -static SysBusDeviceInfo lance_info = { - .init = lance_init, - .qdev.name = "lance", - .qdev.fw_name = "ethernet", - .qdev.size = sizeof(SysBusPCNetState), - .qdev.reset = lance_reset, - .qdev.vmsd = &vmstate_lance, - .qdev.props = (Property[]) { - DEFINE_PROP_PTR("dma", SysBusPCNetState, state.dma_opaque), - DEFINE_NIC_PROPERTIES(SysBusPCNetState, state.conf), - DEFINE_PROP_END_OF_LIST(), - } +static Property lance_properties[] = { + DEFINE_PROP_PTR("dma", SysBusPCNetState, state.dma_opaque), + DEFINE_NIC_PROPERTIES(SysBusPCNetState, state.conf), + DEFINE_PROP_END_OF_LIST(), +}; + +static void lance_class_init(ObjectClass *klass, void *data) +{ + SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); + + k->init = lance_init; +} + +static DeviceInfo lance_info = { + .name = "lance", + .fw_name = "ethernet", + .size = sizeof(SysBusPCNetState), + .reset = lance_reset, + .vmsd = &vmstate_lance, + .props = lance_properties, + .class_init = lance_class_init, }; static void lance_register_devices(void) |