Use the 'modelName' attribute for the pnv-phb4 pcie-root device. Update the virDomainControllerIsPowerNVPHB() helper as well so this device receives the same handling the existing pnv-phb3 has. Signed-off-by: Daniel Henrique Barboza <danielhb413@xxxxxxxxx> --- src/conf/domain_conf.c | 4 ++-- src/qemu/qemu_domain_address.c | 14 +++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 8e7808ac9b..1c2b182c03 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2456,8 +2456,8 @@ virDomainControllerIsPowerNVPHB(const virDomainControllerDef *cont) name = cont->opts.pciopts.modelName; - /* The actual device used for PHBs is pnv-phb3 */ - if (name != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3) + if ((name != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3) && + (name != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB4)) return false; return true; diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index f8b5da8b55..73dafdfda9 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -2424,6 +2424,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, @@ -2476,7 +2488,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: -- 2.34.1