[PATCH v2 26/29] domain_conf.c: add phb4-root-port to IsPowerNVRootPort()

Daniel Henrique Barboza posted 29 patches 4 years ago
There is a newer version of this series
[PATCH v2 26/29] domain_conf.c: add phb4-root-port to IsPowerNVRootPort()
Posted by Daniel Henrique Barboza 4 years ago
Make the virDomainControllerIsPowerNVRootPort() helper recognize
pnv-phb4-root-port as a PowerNV root port. This will spare us from
duplicating checks where the constraints of pnv-phb3-root-port also
applies for the pnv-phb4-root-port device.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
 src/conf/domain_conf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 2b862ffb86..0305c913d9 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -2476,7 +2476,8 @@ virDomainControllerIsPowerNVRootPort(const virDomainControllerDef *cont)
 
     name = cont->opts.pciopts.modelName;
 
-    if (name != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3_ROOT_PORT)
+    if ((name != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3_ROOT_PORT) &&
+        (name != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB4_ROOT_PORT))
         return false;
 
     return true;
-- 
2.34.1

Re: [PATCH v2 26/29] domain_conf.c: add phb4-root-port to IsPowerNVRootPort()
Posted by Ján Tomko 3 years, 11 months ago
On a Tuesday in 2022, Daniel Henrique Barboza wrote:
>Make the virDomainControllerIsPowerNVRootPort() helper recognize
>pnv-phb4-root-port as a PowerNV root port. This will spare us from
>duplicating checks where the constraints of pnv-phb3-root-port also
>applies for the pnv-phb4-root-port device.
>
>Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
>---
> src/conf/domain_conf.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano