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/opencores_eth.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/opencores_eth.c')
-rw-r--r-- | hw/opencores_eth.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/hw/opencores_eth.c b/hw/opencores_eth.c index 5161b0cfc9..1f45506100 100644 --- a/hw/opencores_eth.c +++ b/hw/opencores_eth.c @@ -727,16 +727,25 @@ static void qdev_open_eth_reset(DeviceState *dev) open_eth_reset(d); } -static SysBusDeviceInfo open_eth_info = { - .qdev.name = "open_eth", - .qdev.desc = "Opencores 10/100 Mbit Ethernet", - .qdev.size = sizeof(OpenEthState), - .qdev.reset = qdev_open_eth_reset, - .init = sysbus_open_eth_init, - .qdev.props = (Property[]) { - DEFINE_NIC_PROPERTIES(OpenEthState, conf), - DEFINE_PROP_END_OF_LIST(), - } +static Property open_eth_properties[] = { + DEFINE_NIC_PROPERTIES(OpenEthState, conf), + DEFINE_PROP_END_OF_LIST(), +}; + +static void open_eth_class_init(ObjectClass *klass, void *data) +{ + SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); + + k->init = sysbus_open_eth_init; +} + +static DeviceInfo open_eth_info = { + .name = "open_eth", + .desc = "Opencores 10/100 Mbit Ethernet", + .size = sizeof(OpenEthState), + .reset = qdev_open_eth_reset, + .props = open_eth_properties, + .class_init = open_eth_class_init, }; static void open_eth_register_devices(void) |