]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: don't allow connecting upstream-port directly to pce-expander-bus
authorLaine Stump <laine@laine.org>
Thu, 4 Aug 2016 17:04:12 +0000 (13:04 -0400)
committerLaine Stump <laine@laine.org>
Wed, 10 Aug 2016 14:26:21 +0000 (10:26 -0400)
I apparently misunderstood Marcel's description of what could and
couldn't be plugged into qemu's pxb-pcie controller (known as
pcie-expander-bus in libvirt) - I specifically allowed directly
connecting a pcie-switch-upstream-port, and it turns out that causes
the guest kernel to crash.

This patch forbids such a connection, and updates the xml docs
appropriately.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1361172

docs/formatdomain.html.in
src/conf/domain_addr.c

index 5acb3b94696959367f01b4d6e98e9a651216a37c..bfbb0f2834c1f78396a33ab1c30a0f0d2fb5a3c0 100644 (file)
           2nd bus-number is just being reserved for the pcie-root-port
           that must necessarily be connected to the bus in order to
           actually plug in an endpoint device. If you intend to plug
-          multiple devices into a pcie-expander-bus, you must instead
-          connect a pcie-switch-upstream-port to the
-          pcie-expander-bus, and multiple pcie-switch-downstream-ports
-          to the pcie-switch-downstream-port, and of course for this
-          to work properly, you will need to decrease the
-          pcie-expander-bus' busNr accordingly so that there are
-          enough unused bus numbers above it to accomodate giving out
-          one bus number for the upstream-port and one for each
-          downstream-port).
+          multiple devices into a pcie-expander-bus, you must connect
+          a pcie-switch-upstream-port to the pcie-root-port that is
+          plugged into the pcie-expander-bus, and multiple
+          pcie-switch-downstream-ports to the
+          pcie-switch-upstream-port, and of course for this to work
+          properly, you will need to decrease the pcie-expander-bus'
+          busNr accordingly so that there are enough unused bus
+          numbers above it to accomodate giving out one bus number for
+          the upstream-port and one for each downstream-port (in
+          addition to the pcie-root-port and the pcie-expander-bus
+          itself).
         </p>
       </dd>
       <dt><code>node</code></dt>
index a2c3056a7c1ed55f9fee41602feee1b47f0f17ea..3d3ecbeed4065299a4a303d123027fbe75e5dab0 100644 (file)
@@ -291,11 +291,8 @@ virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus,
         bus->maxSlot = VIR_PCI_ADDRESS_SLOT_LAST;
         break;
     case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_EXPANDER_BUS:
-        /* single slot, no hotplug, only accepts pcie-root-port or
-         * pcie-switch-upstream-port.
-         */
-        bus->flags = (VIR_PCI_CONNECT_TYPE_PCIE_ROOT_PORT
-                      | VIR_PCI_CONNECT_TYPE_PCIE_SWITCH_UPSTREAM_PORT);
+        /* single slot, no hotplug, only accepts pcie-root-port */
+        bus->flags = VIR_PCI_CONNECT_TYPE_PCIE_ROOT_PORT;
         bus->minSlot = 0;
         bus->maxSlot = 0;
         break;