aboutsummaryrefslogtreecommitdiff
path: root/blockdev.c
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2019-03-12 12:05:48 -0400
committerJohn Snow <jsnow@redhat.com>2019-03-12 12:05:48 -0400
commit27a1b301a448a0426a96716484fc034b73c10c51 (patch)
treeaa3d545a9355cfd2a3c0a021566f9a045d5fece0 /blockdev.c
parent21d2376f264bcaa1692bd71ab1f99b9b0ff5afbf (diff)
block/dirty-bitmaps: unify qmp_locked and user_locked calls
These mean the same thing now. Unify them and rename the merged call bdrv_dirty_bitmap_busy to indicate semantically what we are describing, as well as help disambiguate from the various _locked and _unlocked versions of bitmap helpers that refer to mutex locks. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-id: 20190223000614.13894-8-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'blockdev.c')
-rw-r--r--blockdev.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/blockdev.c b/blockdev.c
index 871966ca13..efd184f504 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -2011,7 +2011,7 @@ static void block_dirty_bitmap_clear_prepare(BlkActionState *common,
return;
}
- if (bdrv_dirty_bitmap_user_locked(state->bitmap)) {
+ if (bdrv_dirty_bitmap_busy(state->bitmap)) {
error_setg(errp, "Cannot modify a bitmap in use by another operation");
return;
} else if (bdrv_dirty_bitmap_readonly(state->bitmap)) {
@@ -2060,7 +2060,7 @@ static void block_dirty_bitmap_enable_prepare(BlkActionState *common,
return;
}
- if (bdrv_dirty_bitmap_user_locked(state->bitmap)) {
+ if (bdrv_dirty_bitmap_busy(state->bitmap)) {
error_setg(errp,
"Bitmap '%s' is currently in use by another operation"
" and cannot be enabled", action->name);
@@ -2101,7 +2101,7 @@ static void block_dirty_bitmap_disable_prepare(BlkActionState *common,
return;
}
- if (bdrv_dirty_bitmap_user_locked(state->bitmap)) {
+ if (bdrv_dirty_bitmap_busy(state->bitmap)) {
error_setg(errp,
"Bitmap '%s' is currently in use by another operation"
" and cannot be disabled", action->name);
@@ -2895,7 +2895,7 @@ void qmp_block_dirty_bitmap_remove(const char *node, const char *name,
return;
}
- if (bdrv_dirty_bitmap_user_locked(bitmap)) {
+ if (bdrv_dirty_bitmap_busy(bitmap)) {
error_setg(errp,
"Bitmap '%s' is currently in use by another operation and"
" cannot be removed", name);
@@ -2934,7 +2934,7 @@ void qmp_block_dirty_bitmap_clear(const char *node, const char *name,
return;
}
- if (bdrv_dirty_bitmap_user_locked(bitmap)) {
+ if (bdrv_dirty_bitmap_busy(bitmap)) {
error_setg(errp,
"Bitmap '%s' is currently in use by another operation"
" and cannot be cleared", name);
@@ -2958,7 +2958,7 @@ void qmp_block_dirty_bitmap_enable(const char *node, const char *name,
return;
}
- if (bdrv_dirty_bitmap_user_locked(bitmap)) {
+ if (bdrv_dirty_bitmap_busy(bitmap)) {
error_setg(errp,
"Bitmap '%s' is currently in use by another operation"
" and cannot be enabled", name);
@@ -2979,7 +2979,7 @@ void qmp_block_dirty_bitmap_disable(const char *node, const char *name,
return;
}
- if (bdrv_dirty_bitmap_user_locked(bitmap)) {
+ if (bdrv_dirty_bitmap_busy(bitmap)) {
error_setg(errp,
"Bitmap '%s' is currently in use by another operation"
" and cannot be disabled", name);
@@ -3561,7 +3561,7 @@ static BlockJob *do_drive_backup(DriveBackup *backup, JobTxn *txn,
bdrv_unref(target_bs);
goto out;
}
- if (bdrv_dirty_bitmap_user_locked(bmap)) {
+ if (bdrv_dirty_bitmap_busy(bmap)) {
error_setg(errp,
"Bitmap '%s' is currently in use by another operation"
" and cannot be used for backup", backup->bitmap);
@@ -3674,7 +3674,7 @@ BlockJob *do_blockdev_backup(BlockdevBackup *backup, JobTxn *txn,
error_setg(errp, "Bitmap '%s' could not be found", backup->bitmap);
goto out;
}
- if (bdrv_dirty_bitmap_user_locked(bmap)) {
+ if (bdrv_dirty_bitmap_busy(bmap)) {
error_setg(errp,
"Bitmap '%s' is currently in use by another operation"
" and cannot be used for backup", backup->bitmap);