]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: Use the correct limit for the number of PHBs
authorAndrea Bolognani <abologna@redhat.com>
Thu, 17 Aug 2017 15:19:57 +0000 (17:19 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 21 Aug 2017 11:11:49 +0000 (13:11 +0200)
I mistakenly thought pSeries guests supported 32 PHBs,
but it turns out they only support 31. Validate the
target index accordingly.

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
src/conf/domain_conf.c
tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-invalid-target-index-3.xml

index d207ed5bf6ea311c1d4b73266bbbb078c114dd84..00d977cd95bcd4f655d405a39282a16c4a1d61de 100644 (file)
@@ -5083,10 +5083,10 @@ virDomainControllerDefValidate(const virDomainControllerDef *controller)
         /* Only validate the target index if it's been set */
         if (opts->targetIndex != -1) {
 
-            if (opts->targetIndex < 0 || opts->targetIndex > 31) {
+            if (opts->targetIndex < 0 || opts->targetIndex > 30) {
                 virReportError(VIR_ERR_XML_ERROR,
                                _("PCI controller target index '%d' out of "
-                                 "range - must be 0-31"),
+                                 "range - must be 0-30"),
                                opts->targetIndex);
                 return -1;
             }
index 864c5d8758885e71a9b391cf0733a5532f77ebd3..3d99da4995e596d8b5e52beec5e94de17ea51c4c 100644 (file)
@@ -8,10 +8,10 @@
   </os>
   <devices>
     <emulator>/usr/bin/qemu-system-ppc64</emulator>
-    <!-- QEMU only supports 32 PHBs with target index in the range 0-31,
-         so attempting to use target index 32 should fail -->
+    <!-- QEMU only supports 31 PHBs with target index in the range 0-30,
+         so attempting to use target index 31 should fail -->
     <controller type='pci' model='pci-root'>
-      <target index='32'/>
+      <target index='31'/>
     </controller>
     <controller type='usb' model='none'/>
     <memballoon model='none'/>