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; }