summaryrefslogtreecommitdiff
path: root/hw/isa-bus.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-02-16 11:27:26 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2013-02-18 08:39:27 -0600
commitc538ca66ffec97432057d3fe1aa5a4bb417ae9e9 (patch)
treed099300bafd605444eff3c0fbf1974aa8c5f9002 /hw/isa-bus.c
parent872536bf5dfdf207d275cd627caec2aefb68aab9 (diff)
isa: Split off instance_init for ISADevice
Prepares for assigning IRQs before QOM realize. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Andreas Färber <afaerber@suse.de> Message-id: 1361010446-1427-1-git-send-email-afaerber@suse.de Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/isa-bus.c')
-rw-r--r--hw/isa-bus.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/hw/isa-bus.c b/hw/isa-bus.c
index fce311bc2..6dc34f09f 100644
--- a/hw/isa-bus.c
+++ b/hw/isa-bus.c
@@ -124,9 +124,6 @@ static int isa_qdev_init(DeviceState *qdev)
ISADevice *dev = ISA_DEVICE(qdev);
ISADeviceClass *klass = ISA_DEVICE_GET_CLASS(dev);
- dev->isairq[0] = -1;
- dev->isairq[1] = -1;
-
if (klass->init) {
return klass->init(dev);
}
@@ -134,6 +131,14 @@ static int isa_qdev_init(DeviceState *qdev)
return 0;
}
+static void isa_device_init(Object *obj)
+{
+ ISADevice *dev = ISA_DEVICE(obj);
+
+ dev->isairq[0] = -1;
+ dev->isairq[1] = -1;
+}
+
ISADevice *isa_create(ISABus *bus, const char *name)
{
DeviceState *dev;
@@ -233,6 +238,7 @@ static const TypeInfo isa_device_type_info = {
.name = TYPE_ISA_DEVICE,
.parent = TYPE_DEVICE,
.instance_size = sizeof(ISADevice),
+ .instance_init = isa_device_init,
.abstract = true,
.class_size = sizeof(ISADeviceClass),
.class_init = isa_device_class_init,