Similar to the existing pnv-phb3 device, pnv-phb4 is also an
implementation of pcie-root. No user doc is needed in this case since
the user doesn't ideally set PCI model names manually.
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413(a)gmail.com>
---
docs/schemas/domaincommon.rng | 1 +
src/conf/domain_conf.c | 1 +
src/conf/domain_conf.h | 1 +
src/qemu/qemu_domain_address.c | 14 +++++++++++++-
src/qemu/qemu_validate.c | 2 ++
5 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 43f78473e1..9a9ce91aeb 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -2599,6 +2599,7 @@
<value>i82801b11-bridge</value>
<!-- implementations of "pcie-root" -->
<value>pnv-phb3</value>
+ <value>pnv-phb4</value>
<!-- implementations of "pcie-to-pci-bridge" -->
<value>pcie-pci-bridge</value>
<!-- implementations of "pcie-root-port" -->
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index c6b071c153..9767aa5c7b 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -441,6 +441,7 @@ VIR_ENUM_IMPL(virDomainControllerPCIModelName,
"pnv-phb3-root-port",
"pnv-phb3",
"pnv-phb4-root-port",
+ "pnv-phb4",
);
VIR_ENUM_IMPL(virDomainControllerModelSCSI,
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 1313534622..7e4c0fc786 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -649,6 +649,7 @@ typedef enum {
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3_ROOT_PORT,
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3,
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB4_ROOT_PORT,
+ VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB4,
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_LAST
} virDomainControllerPCIModelName;
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index 9290083f39..9d9da31bc7 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -2425,6 +2425,18 @@ virDomainControllerGetPowerNVRootPortName(virDomainDef *def)
}
+static virDomainControllerPCIModelName
+virDomainControllerGetPowerNVPHBName(virDomainDef *def)
+{
+ if (STREQ(def->os.machine, "powernv8"))
+ return VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3;
+ else if (STREQ(def->os.machine, "powernv9"))
+ return VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB4;
+
+ return VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE;
+}
+
+
static void
qemuDomainPCIControllerSetDefaultModelName(virDomainControllerDef *cont,
virDomainDef *def,
@@ -2477,7 +2489,7 @@ qemuDomainPCIControllerSetDefaultModelName(virDomainControllerDef
*cont,
break;
case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT:
if (qemuDomainIsPowerNV(def))
- *modelName = VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3;
+ *modelName = virDomainControllerGetPowerNVPHBName(def);
break;
case VIR_DOMAIN_CONTROLLER_MODEL_PCI_DEFAULT:
case VIR_DOMAIN_CONTROLLER_MODEL_PCI_LAST:
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index 37e7c5616c..2d813355d3 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -3439,6 +3439,8 @@ virValidateControllerPCIModelNameToQEMUCaps(int modelName)
return QEMU_CAPS_DEVICE_PNV_PHB3;
case VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB4_ROOT_PORT:
return QEMU_CAPS_DEVICE_PNV_PHB4;
+ case VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB4:
+ return QEMU_CAPS_DEVICE_PNV_PHB4;
case VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE:
return 0;
case VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_LAST:
--
2.35.1