aboutsummaryrefslogtreecommitdiff
path: root/migration
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2018-10-29 16:23:16 -0400
committerJohn Snow <jsnow@redhat.com>2018-10-29 16:23:16 -0400
commit993edc0ce0c6f44deb8272a7a857e419417f5f84 (patch)
treef45f81f8a4f3dcb77db140166c5c99ef6ce55642 /migration
parent2ea427effff61efa5d0dc69f9cae126d13879617 (diff)
block/dirty-bitmaps: add user_locked status checker
Instead of both frozen and qmp_locked checks, wrap it into one check. frozen implies the bitmap is split in two (for backup), and shouldn't be modified. qmp_locked implies it's being used by another operation, like being exported over NBD. In both cases it means we shouldn't allow the user to modify it in any meaningful way. Replace any usages where we check both frozen and qmp_locked with the new check. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 20181002230218.13949-2-jsnow@redhat.com [w/edits Suggested-By: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>] Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'migration')
-rw-r--r--migration/block-dirty-bitmap.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index 477826330c..dfbfb853b7 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -301,14 +301,8 @@ static int init_dirty_bitmap_migration(void)
goto fail;
}
- if (bdrv_dirty_bitmap_frozen(bitmap)) {
- error_report("Can't migrate frozen dirty bitmap: '%s",
- bdrv_dirty_bitmap_name(bitmap));
- goto fail;
- }
-
- if (bdrv_dirty_bitmap_qmp_locked(bitmap)) {
- error_report("Can't migrate locked dirty bitmap: '%s",
+ if (bdrv_dirty_bitmap_user_locked(bitmap)) {
+ error_report("Can't migrate a bitmap that is in use by another operation: '%s'",
bdrv_dirty_bitmap_name(bitmap));
goto fail;
}