mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-09-09 01:04:59 +00:00
virDomainNetDefParseXML: Use virXMLPropEnumDefault for parsing 'def->type'
Replace ad-hoc logic that fills the default by use of the proper helper function. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
9de4835987
commit
5832c73a82
@ -9002,13 +9002,10 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt,
|
||||
|
||||
ctxt->node = node;
|
||||
|
||||
if ((rv = virXMLPropEnum(node, "type", virDomainNetTypeFromString,
|
||||
VIR_XML_PROP_NONE, &def->type)) < 0)
|
||||
if (virXMLPropEnumDefault(node, "type", virDomainNetTypeFromString,
|
||||
VIR_XML_PROP_NONE, &def->type, VIR_DOMAIN_NET_TYPE_USER) < 0)
|
||||
return NULL;
|
||||
|
||||
if (rv == 0)
|
||||
def->type = VIR_DOMAIN_NET_TYPE_USER;
|
||||
|
||||
if (virXMLPropTristateBool(node, "trustGuestRxFilters", VIR_XML_PROP_NONE,
|
||||
&def->trustGuestRxFilters) < 0)
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user