[libvirt] [PATCH 3/3] libxl: remove unneeded cleanup_unlock label

Michal Privoznik mprivozn at redhat.com
Thu Mar 5 14:15:16 UTC 2015


On 04.03.2015 01:09, Jim Fehlig wrote:
> In the old days of a global driver lock, it was necessary to unlock
> the driver after a domain restore operation.  When the global lock
> was removed from the driver, some remnants were left behind in
> libxlDomainRestoreFlags.  Remove this unneeded (and incorrect) code.
> 
> Signed-off-by: Jim Fehlig <jfehlig at suse.com>
> ---
>  src/libxl/libxl_driver.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
> index ce3a99b..55fa64f 100644
> --- a/src/libxl/libxl_driver.c
> +++ b/src/libxl/libxl_driver.c
> @@ -1464,17 +1464,17 @@ libxlDomainRestoreFlags(virConnectPtr conn, const char *from,
>  
>      fd = libxlDomainSaveImageOpen(driver, cfg, from, &def, &hdr);
>      if (fd < 0)
> -        goto cleanup_unlock;
> +        return -1;

While this one is okay, ...

>  
>      if (virDomainRestoreFlagsEnsureACL(conn, def) < 0)
> -        goto cleanup_unlock;
> +        return -1;

.. this one's not. If EnsureACL fails, the @fd opened just above is
leaked. ACKed with s/return -1/goto cleanup/.

Michal




More information about the libvir-list mailing list