Re: [PATCH 04/14] blockdev: fix drive_backup_prepare() missed error

2020-09-17 Thread Alberto Garcia
On Wed 09 Sep 2020 08:59:20 PM CEST, Vladimir Sementsov-Ogievskiy wrote:
> We leak local_err and don't report failure to the caller. It's
> definitely wrong, let's fix.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy 

Reviewed-by: Alberto Garcia 

Berto



Re: [PATCH 04/14] blockdev: fix drive_backup_prepare() missed error

2020-09-10 Thread Greg Kurz
On Wed,  9 Sep 2020 21:59:20 +0300
Vladimir Sementsov-Ogievskiy  wrote:

> We leak local_err and don't report failure to the caller. It's
> definitely wrong, let's fix.
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy 
> ---

Reviewed-by: Greg Kurz 

>  blockdev.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/blockdev.c b/blockdev.c
> index 36bef6b188..74259527c1 100644
> --- a/blockdev.c
> +++ b/blockdev.c
> @@ -1797,8 +1797,7 @@ static void drive_backup_prepare(BlkActionState 
> *common, Error **errp)
>  aio_context_acquire(aio_context);
>  
>  if (set_backing_hd) {
> -bdrv_set_backing_hd(target_bs, source, _err);
> -if (local_err) {
> +if (bdrv_set_backing_hd(target_bs, source, errp) < 0) {
>  goto unref;
>  }
>  }




[PATCH 04/14] blockdev: fix drive_backup_prepare() missed error

2020-09-09 Thread Vladimir Sementsov-Ogievskiy
We leak local_err and don't report failure to the caller. It's
definitely wrong, let's fix.

Signed-off-by: Vladimir Sementsov-Ogievskiy 
---
 blockdev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/blockdev.c b/blockdev.c
index 36bef6b188..74259527c1 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -1797,8 +1797,7 @@ static void drive_backup_prepare(BlkActionState *common, 
Error **errp)
 aio_context_acquire(aio_context);
 
 if (set_backing_hd) {
-bdrv_set_backing_hd(target_bs, source, _err);
-if (local_err) {
+if (bdrv_set_backing_hd(target_bs, source, errp) < 0) {
 goto unref;
 }
 }
-- 
2.21.3