mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
virsh: Use proper helper for parsing XML in virshDumpXML
Use virXMLParseStringCtxt instead of virXMLParseString since the code requires a XPath context anyways. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
402c31f3ac
commit
f1cd95cc28
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user