[libvirt] [PATCH 3/6] qemu_driver: use VIR_AUTOUNREF() with virQEMUDriverConfigPtr 3/3

Erik Skultety eskultet at redhat.com
Fri Sep 27 07:43:23 UTC 2019


On Thu, Sep 26, 2019 at 01:15:16PM -0300, Daniel Henrique Barboza wrote:
>
>
> On 9/26/19 6:18 AM, Erik Skultety wrote:
> > On Wed, Sep 18, 2019 at 11:56:55AM -0300, Daniel Henrique Barboza wrote:
> > > virQEMUDriverConfigPtr can be auto-unref for the great majority
> > > of the uses made in qemu_driver, sparing us a virObjectUnref()
> > > call and sometimes a whole 'cleanup' label.
> > >
> > > This patch changes virQEMUDriverConfigPtr declarations to
> > > use VIR_AUTOUNREF(). 'cleanup' labels were deleted when
> > > applicable.
> > >
> > > This is the last part of this change. All but one* instance of
> > > virQEMUDriverConfigPtr were changed to use VIR_AUTOUNREF().
> > > 'cleanup' labels were deleted when applicable.
> > >
> > > * qemuStateInitialize: we can't auto-unref the pointer since we're
> > > initializing the qemu_driver object with it.
> > >
> > > Signed-off-by: Daniel Henrique Barboza <danielhb413 at gmail.com>
> > > ---
> > I know you focused on virQEMUDriverConfigPtr primarily, but since you're
> > following up with VIR_AUTOFREE and touching qemu_driver only, I'd like to do a
> > better job and use VIR_AUTOUNREF at many more places across the file for:
> >
> > virCapsPtr caps
> > virConnectPtr conn
> > qemuDomainSaveCookiePtr cookie
> > virQEMUCapsPtr qemuCaps
> > qemuBlockJobDataPtr job
> > virDomainCapsPtr domCaps
> > virNetworkPtr network
>
> No problem. Should I squash the first 3 patches of this series into a single

I would have squashed those 3 into a single one before pushing anyway.

> one that will touch only virQEMUDriverConfigPtr and then make one patch
> for each pointer type that's changed?

Ultimately I'd have all the VIR_AUTOUNREF changes touching the same file in a
single patch, but for review purposes it may be even better to have them split
in order to separate the changes I've already reviewed and the ones you'll
introduce.

Erik




More information about the libvir-list mailing list