aboutsummaryrefslogtreecommitdiff
path: root/hw/ide
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-12-04 11:52:49 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2012-01-27 10:50:47 -0600
commit8f04ee0882aec9fe91fb70f767edf5dacff59835 (patch)
tree01ebc9678569233858c2343c9cb04e62c2df55ad /hw/ide
parente855761ca8fa08ebe29c1e69abc6f0863a453f92 (diff)
downloadqemu-8f04ee0882aec9fe91fb70f767edf5dacff59835.zip
qemu-8f04ee0882aec9fe91fb70f767edf5dacff59835.tar.gz
qemu-8f04ee0882aec9fe91fb70f767edf5dacff59835.tar.bz2
isa: pic: convert to QEMU Object Model
This converts two devices at once because PIC subclasses ISA and converting subclasses independently is extremely hard. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/ide')
-rw-r--r--hw/ide/isa.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/hw/ide/isa.c b/hw/ide/isa.c
index 219f3a4..464473a 100644
--- a/hw/ide/isa.c
+++ b/hw/ide/isa.c
@@ -94,13 +94,19 @@ ISADevice *isa_ide_init(ISABus *bus, int iobase, int iobase2, int isairq,
return dev;
}
-static ISADeviceInfo isa_ide_info = {
- .qdev.name = "isa-ide",
- .qdev.fw_name = "ide",
- .qdev.size = sizeof(ISAIDEState),
- .init = isa_ide_initfn,
- .qdev.reset = isa_ide_reset,
- .qdev.props = (Property[]) {
+static void isa_ide_class_initfn(ObjectClass *klass, void *data)
+{
+ ISADeviceClass *ic = ISA_DEVICE_CLASS(klass);
+ ic->init = isa_ide_initfn;
+}
+
+static DeviceInfo isa_ide_info = {
+ .name = "isa-ide",
+ .fw_name = "ide",
+ .size = sizeof(ISAIDEState),
+ .class_init = isa_ide_class_initfn,
+ .reset = isa_ide_reset,
+ .props = (Property[]) {
DEFINE_PROP_HEX32("iobase", ISAIDEState, iobase, 0x1f0),
DEFINE_PROP_HEX32("iobase2", ISAIDEState, iobase2, 0x3f6),
DEFINE_PROP_UINT32("irq", ISAIDEState, isairq, 14),