Reviewed-by: Ján Tomko <jtomko@xxxxxxxxxx> Signed-off-by: Daniel Henrique Barboza <danielhb413@xxxxxxxxx> --- src/conf/domain_conf.c | 19 +++++++++++++++++++ src/conf/domain_conf.h | 1 + src/libvirt_private.syms | 1 + 3 files changed, 21 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 44327e2abb..f72045eb39 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2447,6 +2447,25 @@ virDomainControllerIsPSeriesPHB(const virDomainControllerDef *cont) } +bool +virDomainControllerIsPowerNVPHB(const virDomainControllerDef *cont) +{ + virDomainControllerPCIModelName name; + + if (cont->type != VIR_DOMAIN_CONTROLLER_TYPE_PCI || + cont->model != VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT) { + return false; + } + + name = cont->opts.pciopts.modelName; + + 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 7938c4aa19..404289aa26 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -3338,6 +3338,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 6f0d72ca38..8bbecf2692 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -287,6 +287,7 @@ virDomainControllerFindByType; virDomainControllerFindUnusedIndex; virDomainControllerInsert; virDomainControllerInsertPreAlloced; +virDomainControllerIsPowerNVPHB; virDomainControllerIsPSeriesPHB; virDomainControllerModelIDETypeFromString; virDomainControllerModelIDETypeToString; -- 2.35.1