Re: [PATCH 04/10] conf: Clean up virDomain{Memory, Shmem}DefParseXML()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux