diff options
Diffstat (limited to 'nbd')
-rw-r--r-- | nbd/server.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/nbd/server.c b/nbd/server.c index 8ddfd3e319..6c6cade12b 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -1510,6 +1510,11 @@ NBDExport *nbd_export_new(BlockDriverState *bs, uint64_t dev_offset, goto fail; } + if (bdrv_dirty_bitmap_user_locked(bm)) { + error_setg(errp, "Bitmap '%s' is in use", bitmap); + goto fail; + } + if ((nbdflags & NBD_FLAG_READ_ONLY) && bdrv_is_writable(bs) && bdrv_dirty_bitmap_enabled(bm)) { error_setg(errp, @@ -1518,11 +1523,6 @@ NBDExport *nbd_export_new(BlockDriverState *bs, uint64_t dev_offset, goto fail; } - if (bdrv_dirty_bitmap_user_locked(bm)) { - error_setg(errp, "Bitmap '%s' is in use", bitmap); - goto fail; - } - bdrv_dirty_bitmap_set_qmp_locked(bm, true); exp->export_bitmap = bm; exp->export_bitmap_context = g_strdup_printf("qemu:dirty-bitmap:%s", |