[libvirt] [PATCH 2/6] conf: permit auto-assignment of *non-hotpluggable* PCI devices to pcie-root

Laine Stump laine at laine.org
Mon Aug 8 08:56:53 UTC 2016

Although the slots in pcie-root (aka pcie.0 aka "the PCIe Root
Complex") are PCIe slots, and the PCIe spec usually doesn't like
putting legacy PCI devices in PCIe slots, these are an exception -
"according to my sources" (i.e. I haven't read the spec myself, but
know people who have), the PCIe spec expressly permits legacy PCI
devices plugged directly into the root complex.

This patch changes the connection-type flags for pcie-root to allow
legacy PCI endpoint devices. For now this has no effect in practice,
since qemuDomainAssignDevicePCISlots() sets the HOTPLUGGABLE flag for
all devices except PCI controllers, and pcie-root doesn't allow
devices that have HOTPLUGGABLE set - that will be remedied in later
 src/conf/domain_addr.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c
index 8956295..5533b11 100644
--- a/src/conf/domain_addr.c
+++ b/src/conf/domain_addr.c
@@ -285,12 +285,12 @@ virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus,
-        /* slots 1 - 31, no hotplug, PCIe endpoint device or
-         * pcie-root-port only, unless the address was specified in
-         * user config *and* the particular device being attached also
-         * allows it.
+        /* slots 1 - 31, *no hotplug*
+         * both PCIe and legacy PCI devices are allowed, as well as
+         * pcie-root-port, dmi-to-pci-bridge, and pcie-expander-bus.
         bus->flags = (VIR_PCI_CONNECT_TYPE_PCIE_DEVICE |
+                      VIR_PCI_CONNECT_TYPE_PCI_DEVICE |
                       VIR_PCI_CONNECT_TYPE_PCIE_ROOT_PORT |
                       VIR_PCI_CONNECT_TYPE_DMI_TO_PCI_BRIDGE |

More information about the libvir-list mailing list