On Thu, Jan 20, 2022 at 10:52:18 -0300, Daniel Henrique Barboza wrote:
Use the 'modelName' attribute for the pnv-phb3 pcie-root
device.
Signed-off-by: Daniel Henrique Barboza <danielhb413(a)gmail.com>
---
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;
}
The two hunks above almost look like they belong to the other patch
which added them.
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);
As noted, this wouldn't be necessary if you'd use real capabilities for
the test.
DO_TEST("pseries-basic",
QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE,