mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
util: xml: Remove virXMLParseStringCtxtRoot
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>
This commit is contained in:
parent
e95f681305
commit
a31d427123
@ -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)))
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user