]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Allow multiple bridges when pci-bridges is not available
authorAndrea Bolognani <abologna@redhat.com>
Tue, 21 Feb 2017 12:16:52 +0000 (13:16 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Wed, 22 Feb 2017 17:55:55 +0000 (18:55 +0100)
qemuDomainAssignPCIAddresses() hardcoded the assumption
that the only way to support devices on a non-zero bus is
to add one or more pci-bridges; however, since we now
support a large selection of PCI controllers that can be
used instead, the assumption is no longer true.

Moreover, this check was always redundant, because the
only sensible time to check for the availability of
pci-bridge is when building the QEMU command line, and
such a check is of course already in place.

In fact, there were *two* such checks, but since one of
the two was relying on the incorrect assumption explained
above, and it was redundant anyway, it has been dropped.

src/qemu/qemu_command.c
src/qemu/qemu_domain_address.c

index 6a4f7414f11e6a36d1b957b8acc1e361771b2740..d5da533e5059d9be7d079f8a8fa1429a01cf3e6d 100644 (file)
@@ -342,13 +342,6 @@ qemuBuildDeviceAddressStr(virBufferPtr buf,
             }
         }
 
-        if (info->addr.pci.bus != 0 &&
-            !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_PCI_BRIDGE)) {
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                           _("Multiple PCI buses are not supported "
-                             "with this QEMU binary"));
-            goto cleanup;
-        }
         virBufferAsprintf(buf, ",bus=%s", contAlias);
 
         if (info->addr.pci.multi == VIR_TRISTATE_SWITCH_ON)
index 5b75044cec4e46346bfb2b8c3fb0c7ef3c3203d1..f8995c946d1b6c39ce0fb72290e24a45463fba08 100644 (file)
@@ -1983,9 +1983,7 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def,
     if (qemuDomainFillAllPCIConnectFlags(def, qemuCaps, driver) < 0)
         goto cleanup;
 
-    if (nbuses > 0 &&
-        virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_PCI_BRIDGE)) {
-
+    if (nbuses > 0) {
         /* 1st pass to figure out how many PCI bridges we need */
         if (!(addrs = qemuDomainPCIAddressSetCreate(def, nbuses, true)))
             goto cleanup;
@@ -2109,12 +2107,6 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def,
         nbuses = addrs->nbuses;
         virDomainPCIAddressSetFree(addrs);
         addrs = NULL;
-
-    } else if (max_idx > 0) {
-        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                       _("PCI bridges are not supported "
-                         "by this QEMU binary"));
-        goto cleanup;
     }
 
     if (!(addrs = qemuDomainPCIAddressSetCreate(def, nbuses, false)))