[libvirt] [PATCH 04/10] conf: Clean up virDomain{Memory, Shmem}DefParseXML()
Peter Krempa
pkrempa at redhat.com
Fri Jun 30 11:23:09 UTC 2017
On Fri, Jun 30, 2017 at 13:17:04 +0200, Andrea Bolognani wrote:
> On Fri, 2017-06-30 at 12:50 +0200, Peter Krempa wrote:
> > > if (virDomainDeviceInfoParseXML(node, NULL, &def->info, flags) < 0)
> > > - goto cleanup;
> > > -
> > > + goto error;
> > >
> > > - ret = def;
> > > - def = NULL;
> > > cleanup:
> > > - ctxt->node = save;
> > > VIR_FREE(tmp);
> > > + ctxt->node = save;
> > > + return def;
> > > +
> > > + error:
> > > virDomainShmemDefFree(def);
> > > - return ret;
> > > + def = NULL;
> > > + goto cleanup;
> >
> > I don't see how this is better than it was before.
>
> It's only better in that it follows the same structure as
> other *ParseXML() functions in the same file. Consistency
> FTW! Plus we can drop the 'ret' local variable.
Okay, NACK to the change then. I prefer having less labels.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170630/efb9a2d2/attachment-0001.sig>
More information about the libvir-list
mailing list