]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/grackle: fix PCI bus initialization
authorMarcel Apfelbaum <marcel@redhat.com>
Thu, 14 Jul 2016 13:43:44 +0000 (16:43 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 20 Jul 2016 16:30:26 +0000 (19:30 +0300)
Delay the host-bridge 'realization' until the
PCI root bus is attached.

Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
hw/pci-host/grackle.c

index 8f9121615740a01f0f82430d8b5a57217dd39ccf..2c8acdaacaf6521d84d089ca7ff7e954f42ef02c 100644 (file)
@@ -72,7 +72,6 @@ PCIBus *pci_grackle_init(uint32_t base, qemu_irq *pic,
     GrackleState *d;
 
     dev = qdev_create(NULL, TYPE_GRACKLE_PCI_HOST_BRIDGE);
-    qdev_init_nofail(dev);
     s = SYS_BUS_DEVICE(dev);
     phb = PCI_HOST_BRIDGE(dev);
     d = GRACKLE_PCI_HOST_BRIDGE(dev);
@@ -92,6 +91,7 @@ PCIBus *pci_grackle_init(uint32_t base, qemu_irq *pic,
                                 0, 4, TYPE_PCI_BUS);
 
     pci_create_simple(phb->bus, 0, "grackle");
+    qdev_init_nofail(dev);
 
     sysbus_mmio_map(s, 0, base);
     sysbus_mmio_map(s, 1, base + 0x00200000);