diff mbox

[RFC,v2,18/20] q35: Hack to make root bus accept legacy PCI devices

Message ID 1480111556-32586-19-git-send-email-ehabkost@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Eduardo Habkost Nov. 25, 2016, 10:05 p.m. UTC
I don't know where in the code this information should be
encoded, so suggestions are welcome.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Changes series v1 -> v2:
* (new patch added to series)
---
 hw/pci-host/q35.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox

Patch

diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c
index d4e3109..29a5e39 100644
--- a/hw/pci-host/q35.c
+++ b/hw/pci-host/q35.c
@@ -52,6 +52,16 @@  static void q35_host_realize(DeviceState *dev, Error **errp)
     pci->bus = pci_bus_new(DEVICE(s), "pcie.0",
                            s->mch.pci_address_space, s->mch.address_space_io,
                            0, TYPE_PCIE_BUS);
+
+    {
+    /* The root PCIe bus is different, and also accepts legacy PCI devices */
+    /*FIXME: we need to find a better plance to encode this information */
+    strList *new = g_new0(strList, 1);
+    new->value = g_strdup(INTERFACE_LEGACY_PCI_DEVICE);
+    new->next = BUS(pci->bus)->accepted_device_types;
+    BUS(pci->bus)->accepted_device_types = new;
+    }
+
     PC_MACHINE(qdev_get_machine())->bus = pci->bus;
     qdev_set_parent_bus(DEVICE(&s->mch), BUS(pci->bus));
     qdev_init_nofail(DEVICE(&s->mch));