Use the 'modelName' attribute for the pnv-phb3 pcie-root device. Signed-off-by: Daniel Henrique Barboza <danielhb413@xxxxxxxxx> --- src/qemu/qemu_domain_address.c | 3 +++ src/qemu/qemu_validate.c | 6 ++++-- tests/qemuxml2argvtest.c | 3 ++- tests/qemuxml2xmloutdata/powernv8-basic.xml | 4 +++- tests/qemuxml2xmltest.c | 3 ++- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index c62b9b4230..b7d5c14c3a 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -2449,6 +2449,9 @@ qemuDomainPCIControllerSetDefaultModelName(virDomainControllerDef *cont, *modelName = VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_SPAPR_PCI_HOST_BRIDGE; break; case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT: + if (qemuDomainIsPowerNV(def)) + *modelName = VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3; + break; case VIR_DOMAIN_CONTROLLER_MODEL_PCI_DEFAULT: case VIR_DOMAIN_CONTROLLER_MODEL_PCI_LAST: break; diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 337808f4ea..c21611a349 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -3561,7 +3561,8 @@ qemuValidateDomainDeviceDefControllerPCI(const virDomainControllerDef *cont, break; case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT: - if (pciopts->modelName != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE) { + if (pciopts->modelName != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE && + !qemuDomainIsPowerNV(def)) { virReportControllerInvalidOption(cont, model, modelName, "modelName"); return -1; } @@ -3643,7 +3644,8 @@ qemuValidateDomainDeviceDefControllerPCI(const virDomainControllerDef *cont, break; case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT: - if (pciopts->modelName != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE) { + if (pciopts->modelName != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE && + !qemuDomainIsPowerNV(def)) { virReportControllerInvalidValue(cont, model, modelName, "modelName"); return -1; } diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 7fcfcc83f1..fea6048731 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2218,7 +2218,8 @@ mymain(void) DO_TEST_PARSE_ERROR_NOCAPS("seclabel-device-duplicates"); DO_TEST("powernv8-basic", - QEMU_CAPS_DEVICE_ISA_SERIAL); + QEMU_CAPS_DEVICE_ISA_SERIAL, + QEMU_CAPS_DEVICE_PNV_PHB3); DO_TEST("pseries-basic", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, diff --git a/tests/qemuxml2xmloutdata/powernv8-basic.xml b/tests/qemuxml2xmloutdata/powernv8-basic.xml index 7b798b979d..721d2f9a37 100644 --- a/tests/qemuxml2xmloutdata/powernv8-basic.xml +++ b/tests/qemuxml2xmloutdata/powernv8-basic.xml @@ -14,7 +14,9 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-ppc64</emulator> - <controller type='pci' index='0' model='pcie-root'/> + <controller type='pci' index='0' model='pcie-root'> + <model name='pnv-phb3'/> + </controller> <serial type='pty'> <target type='isa-serial' port='0'> <model name='isa-serial'/> diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 5a19fdbda5..586da92778 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -638,7 +638,8 @@ mymain(void) DO_TEST_CAPS_LATEST("virtio-rng-builtin"); DO_TEST("powernv8-basic", - QEMU_CAPS_DEVICE_ISA_SERIAL); + QEMU_CAPS_DEVICE_ISA_SERIAL, + QEMU_CAPS_DEVICE_PNV_PHB3); DO_TEST("pseries-nvram", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, -- 2.34.1