]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: xml: Remove virXMLParseStringCtxtRoot
authorPeter Krempa <pkrempa@redhat.com>
Fri, 23 Sep 2022 13:38:49 +0000 (15:38 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 6 Oct 2022 08:54:25 +0000 (10:54 +0200)
Remove the seldom used helper in favor of full virXMLParse.

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

index 70501ca76876cfa680e45b773b4e3db20b394eed..7dba65cfebe0d8d555411706578e6a7ce781064b 100644 (file)
@@ -13655,7 +13655,8 @@ virDomainDiskDefParse(const char *xmlStr,
     g_autoptr(xmlDoc) xml = NULL;
     g_autoptr(xmlXPathContext) ctxt = NULL;
 
-    if (!(xml = virXMLParseStringCtxtRoot(xmlStr, _("(disk_definition)"), "disk", &ctxt)))
+    if (!(xml = virXMLParse(NULL, xmlStr, _("(disk_definition)"),
+                            "disk", &ctxt, NULL, false)))
         return NULL;
 
     return virDomainDiskDefParseXML(xmlopt, ctxt->node, ctxt, flags);
@@ -13672,7 +13673,8 @@ virDomainDiskDefParseSource(const char *xmlStr,
     g_autoptr(virStorageSource) src = NULL;
     xmlNodePtr driverNode;
 
-    if (!(xml = virXMLParseStringCtxtRoot(xmlStr, _("(disk_definition)"), "disk", &ctxt)))
+    if (!(xml = virXMLParse(NULL, xmlStr, _("(disk_definition)"),
+                            "disk", &ctxt, NULL, false)))
         return NULL;
 
     if (!(src = virDomainDiskDefParseSourceXML(xmlopt, ctxt->node, ctxt, flags)))
index 4f2f9e7fb1191e44149c24c0f80602f199488f05..0f4fe1451ea4d557cc0768319a78e3ac9a80c4a7 100644 (file)
@@ -667,10 +667,8 @@ virStoragePoolDefParseSourceString(const char *srcSpec,
     g_autoptr(xmlXPathContext) xpath_ctxt = NULL;
     g_autoptr(virStoragePoolSource) def = NULL;
 
-    if (!(doc = virXMLParseStringCtxtRoot(srcSpec,
-                                          _("(storage_source_specification)"),
-                                          "source",
-                                          &xpath_ctxt)))
+    if (!(doc = virXMLParse(NULL, srcSpec, _("(storage_source_specification)"),
+                            "source", &xpath_ctxt, NULL, false)))
         return NULL;
 
     def = g_new0(virStoragePoolSource, 1);
index e70f7b0297eef5693d6865952f0fa24999e8167f..febc7cbdfbbb565e7f7b33bba96345c62e9dcfab 100644 (file)
@@ -230,10 +230,6 @@ virXMLPickShellSafeComment(const char *str1,
 #define virXMLParseStringCtxt(xmlStr, url, pctxt) \
     virXMLParseHelper(VIR_FROM_THIS, NULL, xmlStr, url, NULL, pctxt, NULL, false)
 
-/* virXMLParseStringCtxtRoot is same as above, except it also validates root node name */
-#define virXMLParseStringCtxtRoot(xmlStr, url, rootnode, pctxt) \
-    virXMLParseHelper(VIR_FROM_THIS, NULL, xmlStr, url, rootnode, pctxt, NULL, false)
-
 /**
  * virXMLParseFileCtxt:
  * @filename: file to parse