]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: limit chassisNr, and busNr to a minimum value of 1, not 0
authorLaine Stump <laine@laine.org>
Mon, 20 Jun 2016 18:24:35 +0000 (14:24 -0400)
committerLaine Stump <laine@laine.org>
Tue, 21 Jun 2016 15:54:46 +0000 (11:54 -0400)
In the case of chassisNr (used to set chassis_nr of a pci-bridge
controller), 0 is reserved for / used by the pci[e]-root bus. In the
base of busNr, a value of 0 would mean that the root bus had no places
available to plug in new buses, including the pxb itself (the
documentation I wrote for pxb even noted the limit of busNr as 1.254).

NB: oddly, the "chassis" attribute, which is used for pcie-root-port
and pcie-switch-downstream-port *can* be set to 0, since it's the
combination of {chassis, slot} that needs to be unique, not chassis by
itself (and slot 0 of pcie-root is reserved, while pcie-*-port can use
*only* slot 0).

This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1342962

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

index 7d3436304babca360b471d34fb09b936bd4b7cb2..f660aa685c34cbdfae5ca027a2700d33154fe643 100644 (file)
         control QEMU's "chassis_nr" option for the pci-bridge device
         (normally libvirt automatically sets this to the same value as
         the index attribute of the pci controller). If set, chassisNr
-        must be between 0 and 255.
+        must be between 1 and 255.
       </dd>
       <dt><code>chassis</code></dt>
       <dd>
index f2086826a9e601717889c11bf9ea574234df668b..75ad03f49aa4da551c2394104dc66060ccb2c243 100644 (file)
@@ -8405,11 +8405,11 @@ virDomainControllerDefParseXML(xmlNodePtr node,
                                chassisNr);
                 goto error;
             }
-            if (def->opts.pciopts.chassisNr < 0 ||
+            if (def->opts.pciopts.chassisNr < 1 ||
                 def->opts.pciopts.chassisNr > 255) {
                 virReportError(VIR_ERR_XML_ERROR,
                                _("PCI controller chassisNr '%s' out of range "
-                                 "- must be 0-255"),
+                                 "- must be 1-255"),
                                chassisNr);
                 goto error;
             }
@@ -8456,11 +8456,11 @@ virDomainControllerDefParseXML(xmlNodePtr node,
                                busNr);
                 goto error;
             }
-            if (def->opts.pciopts.busNr < 0 ||
+            if (def->opts.pciopts.busNr < 1 ||
                 def->opts.pciopts.busNr > 254) {
                 virReportError(VIR_ERR_XML_ERROR,
                                _("PCI controller busNr '%s' out of range "
-                                 "- must be 0-254"),
+                                 "- must be 1-254"),
                                busNr);
                 goto error;
             }