summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy2021-02-02 13:49:46 +0100
committerEric Blake2021-03-08 22:14:12 +0100
commit5a11a1ca0d0ed5be52070f1da8de89ef85941183 (patch)
tree189e7b6f8233c8daf9610be51cc02e15cc455d66
parentblock: check return value of bdrv_open_child and drop error propagation (diff)
downloadqemu-5a11a1ca0d0ed5be52070f1da8de89ef85941183.tar.gz
qemu-5a11a1ca0d0ed5be52070f1da8de89ef85941183.tar.xz
qemu-5a11a1ca0d0ed5be52070f1da8de89ef85941183.zip
blockdev: fix drive_backup_prepare() missed error
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 <vsementsov@virtuozzo.com> Reviewed-by: Greg Kurz <groug@kaod.org> Reviewed-by: Alberto Garcia <berto@igalia.com> Message-Id: <20210202124956.63146-5-vsementsov@virtuozzo.com> Signed-off-by: Eric Blake <eblake@redhat.com>
-rw-r--r--blockdev.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/blockdev.c b/blockdev.c
index cd438e60e3..65884a2826 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -1825,9 +1825,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, &local_err);
- if (local_err) {
- error_propagate(errp, local_err);
+ if (bdrv_set_backing_hd(target_bs, source, errp) < 0) {
goto unref;
}
}