[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/11] migration: add_bitmaps_to_list: check disk name once
From: |
Eric Blake |
Subject: |
[PULL 05/11] migration: add_bitmaps_to_list: check disk name once |
Date: |
Tue, 26 May 2020 11:42:05 -0500 |
From: Vladimir Sementsov-Ogievskiy <address@hidden>
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: Andrey Shinkevich <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
[eblake: shorter subject line]
Signed-off-by: Eric Blake <address@hidden>
---
migration/block-dirty-bitmap.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index 69ddf289ddb9..7be1644b330a 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -274,17 +274,22 @@ static int add_bitmaps_to_list(BlockDriverState *bs,
const char *bs_name)
DirtyBitmapMigBitmapState *dbms;
Error *local_err = NULL;
+ bitmap = bdrv_dirty_bitmap_first(bs);
+ if (!bitmap) {
+ return 0;
+ }
+
+ if (!bs_name || strcmp(bs_name, "") == 0) {
+ error_report("Bitmap '%s' in unnamed node can't be migrated",
+ bdrv_dirty_bitmap_name(bitmap));
+ return -1;
+ }
+
FOR_EACH_DIRTY_BITMAP(bs, bitmap) {
if (!bdrv_dirty_bitmap_name(bitmap)) {
continue;
}
- if (!bs_name || strcmp(bs_name, "") == 0) {
- error_report("Found bitmap '%s' in unnamed node %p. It can't "
- "be migrated", bdrv_dirty_bitmap_name(bitmap), bs);
- return -1;
- }
-
if (bdrv_dirty_bitmap_check(bitmap, BDRV_BITMAP_DEFAULT, &local_err)) {
error_report_err(local_err);
return -1;
--
2.26.2
- [PULL 00/11] bitmaps patches for 2020-05-26, Eric Blake, 2020/05/26
- [PULL 01/11] migration: refactor init_dirty_bitmap_migration, Eric Blake, 2020/05/26
- [PULL 02/11] block/dirty-bitmap: add bdrv_has_named_bitmaps helper, Eric Blake, 2020/05/26
- [PULL 03/11] migration: fix bitmaps pre-blockdev migration with mirror job, Eric Blake, 2020/05/26
- [PULL 05/11] migration: add_bitmaps_to_list: check disk name once,
Eric Blake <=
- [PULL 06/11] migration: forbid bitmap migration by generated node-name, Eric Blake, 2020/05/26
- [PULL 04/11] iotests: 194: test also migration of dirty bitmap, Eric Blake, 2020/05/26
- [PULL 08/11] qcow2: Expose bitmaps' size during measure, Eric Blake, 2020/05/26
- [PULL 07/11] iotests: Fix test 178, Eric Blake, 2020/05/26
- [PULL 09/11] qemu-img: Factor out code for merging bitmaps, Eric Blake, 2020/05/26
- [PULL 10/11] qemu-img: Add convert --bitmaps option, Eric Blake, 2020/05/26
- [PULL 11/11] iotests: Add test 291 to for qemu-img bitmap coverage, Eric Blake, 2020/05/26
- Re: [PULL 00/11] bitmaps patches for 2020-05-26, Peter Maydell, 2020/05/27