Signed-off-by: Daniel Henrique Barboza <danielhb413(a)gmail.com>
---
src/conf/domain_conf.c | 21 +++++++++++++++++++++
src/conf/domain_conf.h | 1 +
src/libvirt_private.syms | 1 +
3 files changed, 23 insertions(+)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 803c51d63a..13d5eb5b9d 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -2442,6 +2442,27 @@ virDomainControllerIsPSeriesPHB(const virDomainControllerDef
*cont)
}
+bool
+virDomainControllerIsPowerNVPHB(const virDomainControllerDef *cont)
+{
+ virDomainControllerPCIModelName name;
+
+ /* PowerNV PHBs are pcie-root controllers */
+ if (cont->type != VIR_DOMAIN_CONTROLLER_TYPE_PCI ||
+ cont->model != VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT) {
+ return false;
+ }
+
+ name = cont->opts.pciopts.modelName;
+
+ /* The actual device used for PHBs is pnv-phb3 */
+ if (name != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3)
+ return false;
+
+ return true;
+}
+
+
virDomainFSDef *
virDomainFSDefNew(virDomainXMLOption *xmlopt)
{
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 93c5092f35..adeafa83e7 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -3333,6 +3333,7 @@ virDomainControllerDef
*virDomainControllerDefNew(virDomainControllerType type);
void virDomainControllerDefFree(virDomainControllerDef *def);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainControllerDef, virDomainControllerDefFree);
bool virDomainControllerIsPSeriesPHB(const virDomainControllerDef *cont);
+bool virDomainControllerIsPowerNVPHB(const virDomainControllerDef *cont);
virDomainFSDef *virDomainFSDefNew(virDomainXMLOption *xmlopt);
void virDomainFSDefFree(virDomainFSDef *def);
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index ba3462d849..a18fbd4bb8 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -287,6 +287,7 @@ virDomainControllerFindByType;
virDomainControllerFindUnusedIndex;
virDomainControllerInsert;
virDomainControllerInsertPreAlloced;
+virDomainControllerIsPowerNVPHB;
virDomainControllerIsPSeriesPHB;
virDomainControllerModelIDETypeFromString;
virDomainControllerModelIDETypeToString;
--
2.34.1