From: Peter Krempa Date: Fri, 23 Sep 2022 12:49:01 +0000 (+0200) Subject: util: xml: Remove virXMLParseFile X-Git-Tag: v8.9.0-rc1~95 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=30095f4f4cfc2e764d5ed2458943313066771aa4;p=thirdparty%2Flibvirt.git 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 Reviewed-by: Ján Tomko --- diff --git a/src/util/virxml.h b/src/util/virxml.h index 8f193f60bb..0a272a6024 100644 --- a/src/util/virxml.h +++ b/src/util/virxml.h @@ -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 diff --git a/tests/virschematest.c b/tests/virschematest.c index dd13d82c62..cae502a338 100644 --- a/tests/virschematest.c +++ b/tests/virschematest.c @@ -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)