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

Erik Skultety eskultet at redhat.com
Thu Sep 26 09:18:12 UTC 2019


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

(there may be a few more...)

Erik




More information about the libvir-list mailing list