]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Relax pci-root index requirement for pSeries guests
authorAndrea Bolognani <abologna@redhat.com>
Mon, 27 Feb 2017 19:18:32 +0000 (20:18 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Sat, 15 Jul 2017 12:50:42 +0000 (14:50 +0200)
pSeries guests will soon be allowed to have multiple
PHBs (pci-root controllers), meaning the current check
on the controller index no longer applies to them.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
src/qemu/qemu_domain.c

index bf6c6701430ab8bdba3e434ad1d93715e8cc9157..d4f401ebeea5452fdc298abcb2a1a58117324519 100644 (file)
@@ -3426,9 +3426,13 @@ qemuDomainControllerDefPostParse(virDomainControllerDefPtr cont,
         break;
 
     case VIR_DOMAIN_CONTROLLER_TYPE_PCI:
-        if  ((cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT ||
-              cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT) &&
-             cont->idx != 0) {
+
+        /* pSeries guests can have multiple pci-root controllers,
+         * but other machine types only support a single one */
+        if (!qemuDomainIsPSeries(def) &&
+            (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT ||
+             cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT) &&
+            cont->idx != 0) {
             virReportError(VIR_ERR_XML_ERROR, "%s",
                            _("pci-root and pcie-root controllers "
                              "should have index 0"));