mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
virInterfaceDefParseXML: Inline trivial virInterfaceDefParseName
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
3d54880af1
commit
91624098e0
@ -116,23 +116,6 @@ virInterfaceDefFree(virInterfaceDef *def)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int
|
|
||||||
virInterfaceDefParseName(virInterfaceDef *def,
|
|
||||||
xmlXPathContextPtr ctxt)
|
|
||||||
{
|
|
||||||
char *tmp;
|
|
||||||
|
|
||||||
tmp = virXPathString("string(./@name)", ctxt);
|
|
||||||
if (tmp == NULL) {
|
|
||||||
virReportError(VIR_ERR_XML_ERROR,
|
|
||||||
"%s", _("interface has no name"));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
def->name = tmp;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
virInterfaceDefParseMtu(virInterfaceDef *def,
|
virInterfaceDefParseMtu(virInterfaceDef *def,
|
||||||
xmlXPathContextPtr ctxt)
|
xmlXPathContextPtr ctxt)
|
||||||
@ -662,8 +645,10 @@ virInterfaceDefParseXML(xmlXPathContextPtr ctxt,
|
|||||||
}
|
}
|
||||||
def->type = type;
|
def->type = type;
|
||||||
|
|
||||||
if (virInterfaceDefParseName(def, ctxt) < 0)
|
if (!(def->name = virXMLPropString(ctxt->node, "name"))) {
|
||||||
return NULL;
|
virReportError(VIR_ERR_XML_ERROR, "%s", _("interface has no name"));
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (parentIfType == VIR_INTERFACE_TYPE_LAST) {
|
if (parentIfType == VIR_INTERFACE_TYPE_LAST) {
|
||||||
/* only recognize these in toplevel bond interfaces */
|
/* only recognize these in toplevel bond interfaces */
|
||||||
|
Loading…
Reference in New Issue
Block a user