mirror of https://gitee.com/openkylin/libvirt.git
virInterfaceDefParse: Simplify and cleanup
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
56b4186efc
commit
d8f6e198bf
|
@ -704,14 +704,13 @@ virInterfaceDefParse(const char *xmlStr,
|
|||
unsigned int flags)
|
||||
{
|
||||
g_autoptr(xmlDoc) xml = NULL;
|
||||
virInterfaceDef *def = NULL;
|
||||
|
||||
if ((xml = virXMLParse(filename, xmlStr, _("(interface_definition)"), "interface.rng",
|
||||
flags & VIR_INTERFACE_DEFINE_VALIDATE))) {
|
||||
def = virInterfaceDefParseNode(xml, xmlDocGetRootElement(xml));
|
||||
}
|
||||
xml = virXMLParse(filename, xmlStr, _("(interface_definition)"),
|
||||
"interface.rng", flags & VIR_INTERFACE_DEFINE_VALIDATE);
|
||||
if (!xml)
|
||||
return NULL;
|
||||
|
||||
return def;
|
||||
return virInterfaceDefParseNode(xml, xmlDocGetRootElement(xml));
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue