[libvirt] [PATCH v5 09/16] qemu: Add missing checks for pcie-root-port options

John Ferlan posted 16 patches 7 years, 4 months ago
There is a newer version of this series
[libvirt] [PATCH v5 09/16] qemu: Add missing checks for pcie-root-port options
Posted by John Ferlan 7 years, 4 months ago
From: Andrea Bolognani <abologna@redhat.com>

We format the 'chassis' and 'port' properties on the QEMU command
line later on, so we should make sure they've been set.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: John Ferlan <jferlan@redhat.com>
---
 src/qemu/qemu_command.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 07830f781..d62531110 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -2823,7 +2823,9 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
             break;
         case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT_PORT:
             if (def->opts.pciopts.modelName
-                == VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE) {
+                == VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE ||
+                def->opts.pciopts.chassis == -1 ||
+                def->opts.pciopts.port == -1) {
                 virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                                _("autogenerated pcie-root-port options not set"));
                 goto error;
-- 
2.13.6

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v5 09/16] qemu: Add missing checks for pcie-root-port options
Posted by Michal Privoznik 7 years, 3 months ago
On 01/06/2018 12:47 AM, John Ferlan wrote:
> From: Andrea Bolognani <abologna@redhat.com>
> 
> We format the 'chassis' and 'port' properties on the QEMU command
> line later on, so we should make sure they've been set.
> 
> Signed-off-by: Andrea Bolognani <abologna@redhat.com>
> Signed-off-by: John Ferlan <jferlan@redhat.com>
> ---
>  src/qemu/qemu_command.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 


ACK

Michal

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