[libvirt] [PATCH 1/1] vz: fix raise in vzDomainBlock

Nikolay Shirokovskiy nshirokovskiy at virtuozzo.com
Wed May 3 14:10:38 UTC 2017



On 03.05.2017 13:44, Konstantin Neumoin wrote:
> Need begin job before lookup disk in config,
> because it can be edited at this moment.

I would slightly change commit message to something like:

Put domain access after acquiring job condition, otherwise
another job can change it meanwhile.

Otherwise ACK.

> 
> Signed-off-by: Konstantin Neumoin <kneumoin at virtuozzo.com>
> ---
>  src/vz/vz_driver.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
> index 8f94326..954ca6a 100644
> --- a/src/vz/vz_driver.c
> +++ b/src/vz/vz_driver.c
> @@ -4000,12 +4000,6 @@ vzDomainBlockResize(virDomainPtr domain,
>          size /= 1024;
>      size /= 1024;
>  
> -    if (!(disk = virDomainDiskByName(dom->def, path, false))) {
> -        virReportError(VIR_ERR_INVALID_ARG,
> -                       _("invalid path: %s"), path);
> -        goto cleanup;
> -    }
> -
>      if (vzDomainObjBeginJob(dom) < 0)
>          goto cleanup;
>      job = true;
> @@ -4019,6 +4013,12 @@ vzDomainBlockResize(virDomainPtr domain,
>          goto cleanup;
>      }
>  
> +    if (!(disk = virDomainDiskByName(dom->def, path, false))) {
> +        virReportError(VIR_ERR_INVALID_ARG,
> +                       _("invalid path: %s"), path);
> +        goto cleanup;
> +    }
> +
>      ret = prlsdkResizeImage(dom, disk, size);
>  
>   cleanup:
> 




More information about the libvir-list mailing list