]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: Allow conventional PCI devices to be marked as integrated
authorAndrea Bolognani <abologna@redhat.com>
Thu, 9 Feb 2023 17:15:08 +0000 (18:15 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 13 Feb 2023 09:01:08 +0000 (10:01 +0100)
Integrated PCI devices can be either PCIe (virtio-iommu) or
conventional PCI (pvpanic-pci). Right now libvirt will refuse
to assign an address on pcie.0 for the latter, but that's an
undesirable limitation that we can easily remove.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/domain_addr.c

index 76f9c12ca69e3ce7ccc8eb56b296a1f9f9234cf6..b6534f502c78a655549409edc64f97d60896b7c9 100644 (file)
@@ -306,8 +306,11 @@ virDomainPCIAddressFlagsCompatible(virPCIDeviceAddress *addr,
         if (addr->bus == 0) {
             /* pcie-root doesn't usually allow endpoint devices to be
              * plugged directly into it, but for integrated devices
-             * that's exactly what we want */
-            busFlags |= VIR_PCI_CONNECT_AUTOASSIGN;
+             * that's exactly what we want. It also refuses conventional
+             * PCI devices by default, but in the case of integrated
+             * devices both types are fine */
+            busFlags |= VIR_PCI_CONNECT_TYPE_PCI_DEVICE |
+                        VIR_PCI_CONNECT_AUTOASSIGN;
         } else {
             if (reportError) {
                 virReportError(errType,