[libvirt] [PATCH 10/26] qemu: Relax pci-root index requirement for pSeries guests

Andrea Bolognani posted 26 patches 8 years, 6 months ago
There is a newer version of this series
[libvirt] [PATCH 10/26] qemu: Relax pci-root index requirement for pSeries guests
Posted by Andrea Bolognani 8 years, 6 months ago
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.
---
 src/qemu/qemu_domain.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 18512cb..7dc90fd 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3404,9 +3404,14 @@ 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->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI &&
+            (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"));
-- 
2.7.5

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 10/26] qemu: Relax pci-root index requirement for pSeries guests
Posted by Laine Stump 8 years, 6 months ago
On 06/02/2017 12:07 PM, Andrea Bolognani wrote:
> 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.
> ---
>  src/qemu/qemu_domain.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
> index 18512cb..7dc90fd 100644
> --- a/src/qemu/qemu_domain.c
> +++ b/src/qemu/qemu_domain.c
> @@ -3404,9 +3404,14 @@ 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->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI &&
> +            (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"));
> 

Reviewed-by: Laine Stump <laine@laine.org>

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list