]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: xml: Remove virXMLParseCtxt
authorPeter Krempa <pkrempa@redhat.com>
Fri, 23 Sep 2022 12:53:21 +0000 (14:53 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 6 Oct 2022 08:54:25 +0000 (10:54 +0200)
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>
src/conf/virnetworkobj.c
src/conf/virstorageobj.c
src/util/virxml.h

index d23eb2f4014f4415b3b0ab72b8ade0de3b4be74b..635d2ec0b00f846de60f0fce19d3fbc0b8a07701 100644 (file)
@@ -858,7 +858,7 @@ virNetworkLoadState(virNetworkObjList *nets,
     if ((configFile = virNetworkConfigFile(stateDir, name)) == NULL)
         return NULL;
 
-    if (!(xml = virXMLParseCtxt(configFile, NULL, _("(network status)"), &ctxt)))
+    if (!(xml = virXMLParseFileCtxt(configFile, &ctxt)))
         return NULL;
 
     if (!(node = virXPathNode("//network", ctxt))) {
index 77128a4846c7bc760808a52fcd5913d8223c840f..98d9e0b97ef4260ef03bcff160ec06ed5aabab4a 100644 (file)
@@ -1622,7 +1622,7 @@ virStoragePoolObjLoadState(virStoragePoolObjList *pools,
 
     VIR_DEBUG("loading storage pool state XML '%s'", stateFile);
 
-    if (!(xml = virXMLParseCtxt(stateFile, NULL, _("(pool state)"), &ctxt)))
+    if (!(xml = virXMLParseFileCtxt(stateFile, &ctxt)))
         return NULL;
 
     if (!(node = virXPathNode("//pool", ctxt))) {
index 0a272a6024d46497d06a01fb3e130acca1d0aab1..e70f7b0297eef5693d6865952f0fa24999e8167f 100644 (file)
@@ -216,21 +216,6 @@ virXMLPickShellSafeComment(const char *str1,
 #define virXMLParse(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:
  * @xmlStr: a string to parse