aboutsummaryrefslogtreecommitdiff
path: root/hw/piix4.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-12-04 12:22:06 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2012-01-27 10:50:50 -0600
commit40021f08882aaef93c66c8c740087b6d3031b63a (patch)
treea0429c040df66503d807770a3b89da9a0c70d8ac /hw/piix4.c
parent6e4ec3f9bb32d6f41e4fb30b872d2b7b084bc9a9 (diff)
pci: convert to QEMU Object Model
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/piix4.c')
-rw-r--r--hw/piix4.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/hw/piix4.c b/hw/piix4.c
index 130dfd1cc5..88be53587c 100644
--- a/hw/piix4.c
+++ b/hw/piix4.c
@@ -102,18 +102,24 @@ int piix4_init(PCIBus *bus, ISABus **isa_bus, int devfn)
return d->devfn;
}
-static PCIDeviceInfo piix4_info = {
- .qdev.name = "PIIX4",
- .qdev.desc = "ISA bridge",
- .qdev.size = sizeof(PIIX4State),
- .qdev.vmsd = &vmstate_piix4,
- .qdev.no_user = 1,
- .no_hotplug = 1,
- .init = piix4_initfn,
- .vendor_id = PCI_VENDOR_ID_INTEL,
- /* 82371AB/EB/MB PIIX4 PCI-to-ISA bridge */
- .device_id = PCI_DEVICE_ID_INTEL_82371AB_0,
- .class_id = PCI_CLASS_BRIDGE_ISA,
+static void piix4_class_init(ObjectClass *klass, void *data)
+{
+ PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
+
+ k->no_hotplug = 1;
+ k->init = piix4_initfn;
+ k->vendor_id = PCI_VENDOR_ID_INTEL;
+ k->device_id = PCI_DEVICE_ID_INTEL_82371AB_0;
+ k->class_id = PCI_CLASS_BRIDGE_ISA;
+}
+
+static DeviceInfo piix4_info = {
+ .name = "PIIX4",
+ .desc = "ISA bridge",
+ .size = sizeof(PIIX4State),
+ .vmsd = &vmstate_piix4,
+ .no_user = 1,
+ .class_init = piix4_class_init,
};
static void piix4_register(void)