aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy <vsementsov@openvz.org>2022-05-17 14:12:04 +0300
committerKevin Wolf <kwolf@redhat.com>2022-06-24 17:07:06 +0200
commit775b30b3050a8718130701008a4afcca57e774c4 (patch)
treea44309e7187cdb725c9af9f34296deebd7f5ac15
parent1ab5096b3a9790f28be0399f8642b8cebd3529e0 (diff)
downloadqemu-775b30b3050a8718130701008a4afcca57e774c4.zip
qemu-775b30b3050a8718130701008a4afcca57e774c4.tar.gz
qemu-775b30b3050a8718130701008a4afcca57e774c4.tar.bz2
block: block_dirty_bitmap_merge(): fix error path
At the end we ignore failure of bdrv_merge_dirty_bitmap() and report success. And still set errp. That's wrong. Signed-off-by: Vladimir Sementsov-Ogievskiy <v.sementsov-og@mail.ru> Reviewed-by: Nikita Lapshin <nikita.lapshin@virtuozzo.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20220517111206.23585-2-v.sementsov-og@mail.ru> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r--block/monitor/bitmap-qmp-cmds.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/block/monitor/bitmap-qmp-cmds.c b/block/monitor/bitmap-qmp-cmds.c
index 2b677c4..bd10468 100644
--- a/block/monitor/bitmap-qmp-cmds.c
+++ b/block/monitor/bitmap-qmp-cmds.c
@@ -309,7 +309,10 @@ BdrvDirtyBitmap *block_dirty_bitmap_merge(const char *node, const char *target,
}
/* Merge into dst; dst is unchanged on failure. */
- bdrv_merge_dirty_bitmap(dst, anon, backup, errp);
+ if (!bdrv_merge_dirty_bitmap(dst, anon, backup, errp)) {
+ dst = NULL;
+ goto out;
+ }
out:
bdrv_release_dirty_bitmap(anon);