util: xml: Remove virXMLParseFile

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>
This commit is contained in:
Peter Krempa 2022-09-23 14:49:01 +02:00
parent 9b3828e263
commit 30095f4f4c
2 changed files with 1 additions and 12 deletions

View 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

View 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)