Use the 'modelName' attribute for the pnv-phb3-root-port device.
Signed-off-by: Daniel Henrique Barboza <danielhb413(a)gmail.com>
---
src/qemu/qemu_domain_address.c | 5 +++++
src/qemu/qemu_validate.c | 10 +++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index 18fc34d049..c62b9b4230 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -2420,6 +2420,11 @@ qemuDomainPCIControllerSetDefaultModelName(virDomainControllerDef
*cont,
*modelName = VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_PCI_BRIDGE;
break;
case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT_PORT:
+ if (qemuDomainIsPowerNV(def)) {
+ *modelName = VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3_ROOT_PORT;
+ break;
+ }
+
/* Use generic PCIe Root Ports if available, falling back to
* ioh3420 otherwise */
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_PCIE_ROOT_PORT))
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index bdb7c6f1e6..a5c11c3a9c 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -3598,10 +3598,18 @@ qemuValidateDomainDeviceDefControllerPCI(const
virDomainControllerDef *cont,
case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT_PORT:
if (pciopts->modelName != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_IOH3420
&&
- pciopts->modelName != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_ROOT_PORT)
{
+ pciopts->modelName != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_ROOT_PORT
&&
+ pciopts->modelName !=
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3_ROOT_PORT) {
virReportControllerInvalidValue(cont, model, modelName,
"modelName");
return -1;
}
+
+ if (pciopts->modelName ==
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3_ROOT_PORT &&
+ !qemuDomainIsPowerNV(def)) {
+ virReportControllerInvalidValue(cont, model, modelName,
"modelName");
+ return -1;
+ }
+
break;
case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_UPSTREAM_PORT:
--
2.34.1