[libvirt PATCH] conf: virDomainDefParseMemory: remove pointless assignment

Ján Tomko jtomko at redhat.com
Wed Jun 22 11:46:25 UTC 2022


Evaluate the XPath as a boolean, instead of trying to get a node
out of it.

Signed-off-by: Ján Tomko <jtomko at redhat.com>
---
 src/conf/domain_conf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 9fe930a5d8..709ca53790 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -19184,7 +19184,7 @@ virDomainDefParseMemory(virDomainDef *def,
         }
     }
 
-    if ((node = virXPathNode("./memoryBacking/nosharepages", ctxt)))
+    if (virXPathBoolean("boolean(./memoryBacking/nosharepages)", ctxt))
         def->mem.nosharepages = true;
 
     if (virXPathBoolean("boolean(./memoryBacking/locked)", ctxt))
-- 
2.34.1



More information about the libvir-list mailing list