[PATCH 35/43] virsh: Use proper helper for parsing XML in virshDumpXML

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use virXMLParseStringCtxt instead of virXMLParseString since the code
requires a XPath context anyways.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 tools/virsh-util.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/tools/virsh-util.c b/tools/virsh-util.c
index 8a20f627a1..3c4a084441 100644
--- a/tools/virsh-util.c
+++ b/tools/virsh-util.c
@@ -457,14 +457,11 @@ virshDumpXML(vshControl *ctl,
     }

     oldblanks = xmlKeepBlanksDefault(0);
-    doc = virXMLParseString(xml, url);
+    doc = virXMLParseStringCtxt(xml, url, &ctxt);
     xmlKeepBlanksDefault(oldblanks);
     if (!doc)
         return false;

-    if (!(ctxt = virXMLXPathContextNew(doc)))
-        return false;
-
     if ((nnodes = virXPathNodeSet(xpath, ctxt, &nodes)) < 0) {
         return false;
     }
-- 
2.37.3




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux