Use virXMLParseStringCtxt instead of virXMLParseString since the code
requires a XPath context anyways.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
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