mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
conf: networkport: Remove virNetworkPortDefParseNode
The function is exported but used only intenally, additionally everything it did for the only caller can be replaced by properly using virXMLParse. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
1cd64b7326
commit
0589afb96b
@ -251,42 +251,20 @@ virNetworkPortDefParseXML(xmlXPathContextPtr ctxt)
|
||||
}
|
||||
|
||||
|
||||
virNetworkPortDef *
|
||||
virNetworkPortDefParseNode(xmlDocPtr xml,
|
||||
xmlNodePtr root)
|
||||
{
|
||||
g_autoptr(xmlXPathContext) ctxt = NULL;
|
||||
|
||||
if (STRNEQ((const char *)root->name, "networkport")) {
|
||||
virReportError(VIR_ERR_XML_ERROR,
|
||||
"%s",
|
||||
_("unknown root element for network port"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!(ctxt = virXMLXPathContextNew(xml)))
|
||||
return NULL;
|
||||
|
||||
ctxt->node = root;
|
||||
return virNetworkPortDefParseXML(ctxt);
|
||||
}
|
||||
|
||||
|
||||
static virNetworkPortDef *
|
||||
virNetworkPortDefParse(const char *xmlStr,
|
||||
const char *filename,
|
||||
unsigned int flags)
|
||||
{
|
||||
virNetworkPortDef *def = NULL;
|
||||
g_autoptr(xmlDoc) xml = NULL;
|
||||
g_autoptr(xmlXPathContext) ctxt = NULL;
|
||||
bool validate = flags & VIR_NETWORK_PORT_CREATE_VALIDATE;
|
||||
|
||||
if ((xml = virXMLParse(filename, xmlStr, _("(networkport_definition)"),
|
||||
NULL, NULL, "networkport.rng", validate))) {
|
||||
def = virNetworkPortDefParseNode(xml, xmlDocGetRootElement(xml));
|
||||
}
|
||||
if (!(xml = virXMLParse(filename, xmlStr, _("(networkport_definition)"),
|
||||
"networkport", &ctxt, "networkport.rng", validate)))
|
||||
return NULL;
|
||||
|
||||
return def;
|
||||
return virNetworkPortDefParseXML(ctxt);
|
||||
}
|
||||
|
||||
|
||||
|
@ -80,10 +80,6 @@ void
|
||||
virNetworkPortDefFree(virNetworkPortDef *port);
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetworkPortDef, virNetworkPortDefFree);
|
||||
|
||||
virNetworkPortDef *
|
||||
virNetworkPortDefParseNode(xmlDocPtr xml,
|
||||
xmlNodePtr root);
|
||||
|
||||
virNetworkPortDef *
|
||||
virNetworkPortDefParseString(const char *xml,
|
||||
unsigned int flags);
|
||||
|
@ -1327,7 +1327,6 @@ virNetworkPortDefFormat;
|
||||
virNetworkPortDefFormatBuf;
|
||||
virNetworkPortDefFree;
|
||||
virNetworkPortDefParseFile;
|
||||
virNetworkPortDefParseNode;
|
||||
virNetworkPortDefParseString;
|
||||
virNetworkPortDefSaveStatus;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user