[libvirt PATCH 06/10] virDomainActualNetDefParseXML: Use virXMLProp*

Tim Wiederhake twiederh at redhat.com
Fri Apr 23 14:39:16 UTC 2021


On Fri, 2021-04-23 at 15:35 +0200, Ján Tomko wrote:
> On a Friday in 2021, Tim Wiederhake wrote:
> > 
> > (...)
> >
> > +                goto error;
> > +
> > +            if (rc)
> > +                actual->data.direct.mode = mode;
> 
> You can just pass actual->data.direct.mode as an argument to the
> virXMLPropEnum call, eliminating the need for this if and both of the
> local variables, unless I'm missing something.

acutal->data.direct.mode is an int, so we have to do the extra step.

> >         }
> >     } else if (actual->type == VIR_DOMAIN_NET_TYPE_HOSTDEV) {
> >         virDomainHostdevDef *hostdev = &actual->data.hostdev.def;
> 
> With that addressed:
> Reviewed-by: Ján Tomko <jtomko at redhat.com>
> 
> Jano




More information about the libvir-list mailing list