]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Add missing checks for pcie-root-port options
authorAndrea Bolognani <abologna@redhat.com>
Wed, 6 Dec 2017 10:15:29 +0000 (11:15 +0100)
committerJohn Ferlan <jferlan@redhat.com>
Fri, 2 Feb 2018 19:35:26 +0000 (14:35 -0500)
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>
src/qemu/qemu_command.c

index 87d2032b28f6e067388f4eebb15d2a30155d6db8..58e8e55c86c4f6982ecbb73a988ea9f2d72f767e 100644 (file)
@@ -2816,7 +2816,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;