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/fdc.c | |
parent | 40021f08882aaef93c66c8c740087b6d3031b63a (diff) | |
download | qemu-999e12bbe85c5dcf49bef13bce4f97399c7105f4.zip qemu-999e12bbe85c5dcf49bef13bce4f97399c7105f4.tar.gz qemu-999e12bbe85c5dcf49bef13bce4f97399c7105f4.tar.bz2 |
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/fdc.c')
-rw-r--r-- | hw/fdc.c | 60 |
1 files changed, 39 insertions, 21 deletions
@@ -1992,29 +1992,47 @@ static const VMStateDescription vmstate_sysbus_fdc ={ } }; -static SysBusDeviceInfo sysbus_fdc_info = { - .init = sysbus_fdc_init1, - .qdev.name = "sysbus-fdc", - .qdev.size = sizeof(FDCtrlSysBus), - .qdev.vmsd = &vmstate_sysbus_fdc, - .qdev.reset = fdctrl_external_reset_sysbus, - .qdev.props = (Property[]) { - DEFINE_PROP_DRIVE("driveA", FDCtrlSysBus, state.drives[0].bs), - DEFINE_PROP_DRIVE("driveB", FDCtrlSysBus, state.drives[1].bs), - DEFINE_PROP_END_OF_LIST(), - }, +static Property sysbus_fdc_properties[] = { + DEFINE_PROP_DRIVE("driveA", FDCtrlSysBus, state.drives[0].bs), + DEFINE_PROP_DRIVE("driveB", FDCtrlSysBus, state.drives[1].bs), + DEFINE_PROP_END_OF_LIST(), }; -static SysBusDeviceInfo sun4m_fdc_info = { - .init = sun4m_fdc_init1, - .qdev.name = "SUNW,fdtwo", - .qdev.size = sizeof(FDCtrlSysBus), - .qdev.vmsd = &vmstate_sysbus_fdc, - .qdev.reset = fdctrl_external_reset_sysbus, - .qdev.props = (Property[]) { - DEFINE_PROP_DRIVE("drive", FDCtrlSysBus, state.drives[0].bs), - DEFINE_PROP_END_OF_LIST(), - }, +static void sysbus_fdc_class_init(ObjectClass *klass, void *data) +{ + SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); + + k->init = sysbus_fdc_init1; +} + +static DeviceInfo sysbus_fdc_info = { + .name = "sysbus-fdc", + .size = sizeof(FDCtrlSysBus), + .vmsd = &vmstate_sysbus_fdc, + .reset = fdctrl_external_reset_sysbus, + .props = sysbus_fdc_properties, + .class_init = sysbus_fdc_class_init, +}; + +static Property sun4m_fdc_properties[] = { + DEFINE_PROP_DRIVE("drive", FDCtrlSysBus, state.drives[0].bs), + DEFINE_PROP_END_OF_LIST(), +}; + +static void sun4m_fdc_class_init(ObjectClass *klass, void *data) +{ + SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); + + k->init = sun4m_fdc_init1; +} + +static DeviceInfo sun4m_fdc_info = { + .name = "SUNW,fdtwo", + .size = sizeof(FDCtrlSysBus), + .vmsd = &vmstate_sysbus_fdc, + .reset = fdctrl_external_reset_sysbus, + .props = sun4m_fdc_properties, + .class_init = sun4m_fdc_class_init, }; static void fdc_register_devices(void) |