aboutsummaryrefslogtreecommitdiff
path: root/hw/piix_pci.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2012-08-20 19:08:09 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2012-08-22 10:47:17 -0500
commit67c332fd12326a6ef572f07b9d71370ada6a287f (patch)
tree7080117aafe4c4728d86c251a602615f8bc17b43 /hw/piix_pci.c
parent8558d942b665a9ff0847851615e107308f6386a5 (diff)
downloadqemu-67c332fd12326a6ef572f07b9d71370ada6a287f.zip
qemu-67c332fd12326a6ef572f07b9d71370ada6a287f.tar.gz
qemu-67c332fd12326a6ef572f07b9d71370ada6a287f.tar.bz2
pci: Tidy up PCI host bridges
Adopt the QOM parent field name and enforce QOM-style access via casts. Don't just typedef PCIHostState, either use it directly or embed it. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/piix_pci.c')
-rw-r--r--hw/piix_pci.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/piix_pci.c b/hw/piix_pci.c
index 04ceccf..537fc19 100644
--- a/hw/piix_pci.c
+++ b/hw/piix_pci.c
@@ -36,7 +36,9 @@
* http://download.intel.com/design/chipsets/datashts/29054901.pdf
*/
-typedef PCIHostState I440FXState;
+typedef struct I440FXState {
+ PCIHostState parent_obj;
+} I440FXState;
#define PIIX_NUM_PIC_IRQS 16 /* i8259 * 2 */
#define PIIX_NUM_PIRQS 4ULL /* PIRQ[A-D] */
@@ -274,7 +276,7 @@ static PCIBus *i440fx_common_init(const char *device_name,
dev = qdev_create(NULL, "i440FX-pcihost");
s = PCI_HOST_BRIDGE(dev);
s->address_space = address_space_mem;
- b = pci_bus_new(&s->busdev.qdev, NULL, pci_address_space,
+ b = pci_bus_new(dev, NULL, pci_address_space,
address_space_io, 0);
s->bus = b;
object_property_add_child(qdev_get_machine(), "i440fx", OBJECT(dev), NULL);