From 30095f4f4cfc2e764d5ed2458943313066771aa4 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Fri, 23 Sep 2022 14:49:01 +0200 Subject: [PATCH] util: xml: Remove virXMLParseFile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/util/virxml.h | 11 ----------- tests/virschematest.c | 2 +- 2 files changed, 1 insertion(+), 12 deletions(-) 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)