Replace ad-hoc logic that fills the default by use of the proper helper function. Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- src/conf/domain_conf.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 621b1df6c8..745a7e428c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -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; -- 2.37.1