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

Signed-off-by: Ján Tomko <jto...@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

Reply via email to