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>
This commit is contained in:
John Snow 2019-03-12 12:05:48 -04:00
parent 21d2376f26
commit 27a1b301a4
5 changed files with 36 additions and 42 deletions

View file

@ -1510,7 +1510,7 @@ NBDExport *nbd_export_new(BlockDriverState *bs, uint64_t dev_offset,
goto fail;
}
if (bdrv_dirty_bitmap_user_locked(bm)) {
if (bdrv_dirty_bitmap_busy(bm)) {
error_setg(errp, "Bitmap '%s' is in use", bitmap);
goto fail;
}
@ -1523,7 +1523,7 @@ NBDExport *nbd_export_new(BlockDriverState *bs, uint64_t dev_offset,
goto fail;
}
bdrv_dirty_bitmap_set_qmp_locked(bm, true);
bdrv_dirty_bitmap_set_busy(bm, true);
exp->export_bitmap = bm;
exp->export_bitmap_context = g_strdup_printf("qemu:dirty-bitmap:%s",
bitmap);
@ -1641,7 +1641,7 @@ void nbd_export_put(NBDExport *exp)
}
if (exp->export_bitmap) {
bdrv_dirty_bitmap_set_qmp_locked(exp->export_bitmap, false);
bdrv_dirty_bitmap_set_busy(exp->export_bitmap, false);
g_free(exp->export_bitmap_context);
}