mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
util: xml: Remove virXMLParseCtxt
Convert the two outstanding uses to virXMLParseFileCtxt as they always pass a filename and remove the helper macro. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
30095f4f4c
commit
afa2970b7f
@ -858,7 +858,7 @@ virNetworkLoadState(virNetworkObjList *nets,
|
|||||||
if ((configFile = virNetworkConfigFile(stateDir, name)) == NULL)
|
if ((configFile = virNetworkConfigFile(stateDir, name)) == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!(xml = virXMLParseCtxt(configFile, NULL, _("(network status)"), &ctxt)))
|
if (!(xml = virXMLParseFileCtxt(configFile, &ctxt)))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!(node = virXPathNode("//network", ctxt))) {
|
if (!(node = virXPathNode("//network", ctxt))) {
|
||||||
|
@ -1622,7 +1622,7 @@ virStoragePoolObjLoadState(virStoragePoolObjList *pools,
|
|||||||
|
|
||||||
VIR_DEBUG("loading storage pool state XML '%s'", stateFile);
|
VIR_DEBUG("loading storage pool state XML '%s'", stateFile);
|
||||||
|
|
||||||
if (!(xml = virXMLParseCtxt(stateFile, NULL, _("(pool state)"), &ctxt)))
|
if (!(xml = virXMLParseFileCtxt(stateFile, &ctxt)))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!(node = virXPathNode("//pool", ctxt))) {
|
if (!(node = virXPathNode("//pool", ctxt))) {
|
||||||
|
@ -216,21 +216,6 @@ virXMLPickShellSafeComment(const char *str1,
|
|||||||
#define virXMLParse(filename, xmlStr, url, rootelement, ctxt, schemafile, validate) \
|
#define virXMLParse(filename, xmlStr, url, rootelement, ctxt, schemafile, validate) \
|
||||||
virXMLParseHelper(VIR_FROM_THIS, filename, xmlStr, url, rootelement, ctxt, schemafile, validate)
|
virXMLParseHelper(VIR_FROM_THIS, filename, xmlStr, url, rootelement, ctxt, schemafile, validate)
|
||||||
|
|
||||||
/**
|
|
||||||
* virXMLParseCtxt:
|
|
||||||
* @filename: file to parse, or NULL for string parsing
|
|
||||||
* @xmlStr: if @filename is NULL, a string to parse
|
|
||||||
* @url: if @filename is NULL, an optional filename to attribute the parse to
|
|
||||||
* @pctxt: if non-NULL, populate with a new context object on success,
|
|
||||||
* with (*pctxt)->node pre-set to the root node
|
|
||||||
*
|
|
||||||
* Parse xml from either a file or a string.
|
|
||||||
*
|
|
||||||
* Return the parsed document object, or NULL on failure.
|
|
||||||
*/
|
|
||||||
#define virXMLParseCtxt(filename, xmlStr, url, pctxt) \
|
|
||||||
virXMLParseHelper(VIR_FROM_THIS, filename, xmlStr, url, NULL, pctxt, NULL, false)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* virXMLParseStringCtxt:
|
* virXMLParseStringCtxt:
|
||||||
* @xmlStr: a string to parse
|
* @xmlStr: a string to parse
|
||||||
|
Loading…
x
Reference in New Issue
Block a user