]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: xml: Remove virXMLParseFile
authorPeter Krempa <pkrempa@redhat.com>
Fri, 23 Sep 2022 12:49:01 +0000 (14:49 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 6 Oct 2022 08:54:25 +0000 (10:54 +0200)
Most callers prefer using the XPath context. Convert the last user to
use virXMLParseFileCtxt and remove the helper macro.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/util/virxml.h
tests/virschematest.c

index 8f193f60bb8c03e2837b88f4ef7b91a18cd79172..0a272a6024d46497d06a01fb3e130acca1d0aab1 100644 (file)
@@ -216,17 +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)
 
-/**
- * virXMLParseFile:
- * @filename: file to parse
- *
- * Parse xml from a file.
- *
- * Return the parsed document object, or NULL on failure.
- */
-#define virXMLParseFile(filename) \
-    virXMLParseHelper(VIR_FROM_THIS, filename, NULL, NULL, NULL, NULL, NULL, false)
-
 /**
  * virXMLParseCtxt:
  * @filename: file to parse, or NULL for string parsing
index dd13d82c62d32f603f0f5a94ecedbb7edd8acc99..cae502a33864ef17caedea8ed8c8225914f83962 100644 (file)
@@ -51,7 +51,7 @@ testSchemaValidateXML(const void *args)
     bool shouldFail = virStringHasSuffix(data->xml_path, "-invalid.xml");
     g_autoptr(xmlDoc) xml = NULL;
 
-    if (!(xml = virXMLParseFile(data->xml_path)))
+    if (!(xml = virXMLParseFileCtxt(data->xml_path, NULL)))
         return -1;
 
     if ((virXMLValidatorValidate(data->validator, xml) < 0) != shouldFail)