From e1f7c354f0c5717af65199e36cb6c953ff384779 Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Wed, 6 Dec 2017 11:15:29 +0100 Subject: [PATCH] qemu: Add missing checks for pcie-root-port options 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 --- 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 87d2032b28..58e8e55c86 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -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;