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

Erik Skultety eskultet at redhat.com
Thu Sep 26 09:08:05 UTC 2019


On Wed, Sep 18, 2019 at 11:56:54AM -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.
>
> Since there are a lot of references to change, let's do it in
> 3 steps. This is step 2.
>
> Signed-off-by: Daniel Henrique Barboza <danielhb413 at gmail.com>
> ---
...

> @@ -6360,7 +6348,7 @@ qemuDomainChgIOThread(virQEMUDriverPtr driver,
>                        virDomainIOThreadAction action,
>                        unsigned int flags)
>  {
> -    virQEMUDriverConfigPtr cfg = NULL;
> +    VIR_AUTOUNREF(virQEMUDriverConfigPtr) cfg = NULL;
>      qemuDomainObjPrivatePtr priv;
>      virDomainDefPtr def;
>      virDomainDefPtr persistentDef;
> @@ -6460,7 +6448,6 @@ qemuDomainChgIOThread(virQEMUDriverPtr driver,
>      qemuDomainObjEndJob(driver, vm);
>
>   cleanup:

This 'cleanup' label can be dropped.

Erik




More information about the libvir-list mailing list