diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2011-12-04 12:22:06 -0600 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-01-27 10:50:50 -0600 |
commit | 40021f08882aaef93c66c8c740087b6d3031b63a (patch) | |
tree | a0429c040df66503d807770a3b89da9a0c70d8ac /hw/ide/piix.c | |
parent | 6e4ec3f9bb32d6f41e4fb30b872d2b7b084bc9a9 (diff) |
pci: convert to QEMU Object Model
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/ide/piix.c')
-rw-r--r-- | hw/ide/piix.c | 79 |
1 files changed, 50 insertions, 29 deletions
diff --git a/hw/ide/piix.c b/hw/ide/piix.c index 91b77a2026..832a507a4f 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -237,39 +237,60 @@ PCIDevice *pci_piix4_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn) return dev; } -static PCIDeviceInfo piix3_ide_info = { - .qdev.name = "piix3-ide", - .qdev.size = sizeof(PCIIDEState), - .qdev.no_user = 1, - .no_hotplug = 1, - .init = pci_piix_ide_initfn, - .exit = pci_piix_ide_exitfn, - .vendor_id = PCI_VENDOR_ID_INTEL, - .device_id = PCI_DEVICE_ID_INTEL_82371SB_1, - .class_id = PCI_CLASS_STORAGE_IDE, +static void piix3_ide_class_init(ObjectClass *klass, void *data) +{ + PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); + + k->no_hotplug = 1; + k->init = pci_piix_ide_initfn; + k->exit = pci_piix_ide_exitfn; + k->vendor_id = PCI_VENDOR_ID_INTEL; + k->device_id = PCI_DEVICE_ID_INTEL_82371SB_1; + k->class_id = PCI_CLASS_STORAGE_IDE; +} + +static DeviceInfo piix3_ide_info = { + .name = "piix3-ide", + .size = sizeof(PCIIDEState), + .no_user = 1, + .class_init = piix3_ide_class_init, }; -static PCIDeviceInfo piix3_ide_xen_info = { - .qdev.name = "piix3-ide-xen", - .qdev.size = sizeof(PCIIDEState), - .qdev.no_user = 1, - .qdev.unplug = pci_piix3_xen_ide_unplug, - .init = pci_piix_ide_initfn, - .vendor_id = PCI_VENDOR_ID_INTEL, - .device_id = PCI_DEVICE_ID_INTEL_82371SB_1, - .class_id = PCI_CLASS_STORAGE_IDE, +static void piix3_ide_xen_class_init(ObjectClass *klass, void *data) +{ + PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); + + k->init = pci_piix_ide_initfn; + k->vendor_id = PCI_VENDOR_ID_INTEL; + k->device_id = PCI_DEVICE_ID_INTEL_82371SB_1; + k->class_id = PCI_CLASS_STORAGE_IDE; +} + +static DeviceInfo piix3_ide_xen_info = { + .name = "piix3-ide-xen", + .size = sizeof(PCIIDEState), + .no_user = 1, + .class_init = piix3_ide_xen_class_init, + .unplug = pci_piix3_xen_ide_unplug, }; -static PCIDeviceInfo piix4_ide_info = { - .qdev.name = "piix4-ide", - .qdev.size = sizeof(PCIIDEState), - .qdev.no_user = 1, - .no_hotplug = 1, - .init = pci_piix_ide_initfn, - .exit = pci_piix_ide_exitfn, - .vendor_id = PCI_VENDOR_ID_INTEL, - .device_id = PCI_DEVICE_ID_INTEL_82371AB, - .class_id = PCI_CLASS_STORAGE_IDE, +static void piix4_ide_class_init(ObjectClass *klass, void *data) +{ + PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); + + k->no_hotplug = 1; + k->init = pci_piix_ide_initfn; + k->exit = pci_piix_ide_exitfn; + k->vendor_id = PCI_VENDOR_ID_INTEL; + k->device_id = PCI_DEVICE_ID_INTEL_82371AB; + k->class_id = PCI_CLASS_STORAGE_IDE; +} + +static DeviceInfo piix4_ide_info = { + .name = "piix4-ide", + .size = sizeof(PCIIDEState), + .no_user = 1, + .class_init = piix4_ide_class_init, }; static void piix_ide_register(void) |