From 999e12bbe85c5dcf49bef13bce4f97399c7105f4 Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Tue, 24 Jan 2012 13:12:29 -0600 Subject: 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 --- hw/fw_cfg.c | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) (limited to 'hw/fw_cfg.c') diff --git a/hw/fw_cfg.c b/hw/fw_cfg.c index f953532..e669ed4 100644 --- a/hw/fw_cfg.c +++ b/hw/fw_cfg.c @@ -531,18 +531,27 @@ static int fw_cfg_init1(SysBusDevice *dev) return 0; } -static SysBusDeviceInfo fw_cfg_info = { - .init = fw_cfg_init1, - .qdev.name = "fw_cfg", - .qdev.size = sizeof(FWCfgState), - .qdev.vmsd = &vmstate_fw_cfg, - .qdev.reset = fw_cfg_reset, - .qdev.no_user = 1, - .qdev.props = (Property[]) { - DEFINE_PROP_HEX32("ctl_iobase", FWCfgState, ctl_iobase, -1), - DEFINE_PROP_HEX32("data_iobase", FWCfgState, data_iobase, -1), - DEFINE_PROP_END_OF_LIST(), - }, +static Property fw_cfg_properties[] = { + DEFINE_PROP_HEX32("ctl_iobase", FWCfgState, ctl_iobase, -1), + DEFINE_PROP_HEX32("data_iobase", FWCfgState, data_iobase, -1), + DEFINE_PROP_END_OF_LIST(), +}; + +static void fw_cfg_class_init(ObjectClass *klass, void *data) +{ + SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); + + k->init = fw_cfg_init1; +} + +static DeviceInfo fw_cfg_info = { + .name = "fw_cfg", + .size = sizeof(FWCfgState), + .vmsd = &vmstate_fw_cfg, + .reset = fw_cfg_reset, + .no_user = 1, + .props = fw_cfg_properties, + .class_init = fw_cfg_class_init, }; static void fw_cfg_register_devices(void) -- cgit v1.1