The command line for the pnv-phb3 device is similar to the
spapr-pci-host-bridge command line but adding the extra 'chip-id'
attribute.
Signed-off-by: Daniel Henrique Barboza <danielhb413(a)gmail.com>
---
src/qemu/qemu_command.c | 21 +++++++++++++++++++--
tests/qemuxml2argvdata/powernv8-basic.args | 1 +
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 60b4f96e06..1948eff91f 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3220,6 +3220,22 @@ qemuBuildControllerPCIDevProps(virDomainControllerDef *def,
break;
case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT:
+ if (!virDomainControllerIsPowerNVPHB(def)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Unsupported PCI Express root controller"));
+ return -1;
+ }
+
+ if (virJSONValueObjectAdd(&props,
+ "s:driver", modelName,
+ "i:index", pciopts->targetIndex,
+ "i:chip-id", pciopts->chipId,
+ "s:id", def->info.alias,
+ NULL) < 0)
+ return -1;
+
+ break;
+
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Unsupported PCI Express root controller"));
return -1;
@@ -3407,8 +3423,9 @@ static bool
qemuBuildSkipController(const virDomainControllerDef *controller,
const virDomainDef *def)
{
- /* skip pcie-root */
- if (controller->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI &&
+ /* skip pcie-root for non PowerVM domains */
+ if (!qemuDomainIsPowerNV(def) &&
+ controller->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI &&
controller->model == VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT)
return true;
diff --git a/tests/qemuxml2argvdata/powernv8-basic.args
b/tests/qemuxml2argvdata/powernv8-basic.args
index 822cf62bdf..aa81454b08 100644
--- a/tests/qemuxml2argvdata/powernv8-basic.args
+++ b/tests/qemuxml2argvdata/powernv8-basic.args
@@ -25,6 +25,7 @@ QEMU_AUDIO_DRV=none \
-rtc base=utc \
-no-shutdown \
-boot strict=on \
+-device pnv-phb3,index=0,chip-id=0,id=pcie.0 \
-usb \
-chardev pty,id=charserial0 \
-device isa-serial,chardev=charserial0,id=serial0,index=0 \
--
2.34.1