[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH v3 05/10] nbd: change error checking order for bitma
From: |
John Snow |
Subject: |
[Qemu-block] [PATCH v3 05/10] nbd: change error checking order for bitmaps |
Date: |
Fri, 22 Feb 2019 19:06:09 -0500 |
Check that the bitmap is not in use prior to it checking if it is
not enabled/recording guest writes. The bitmap being busy was likely
at the behest of the user, so this error has a greater chance of being
understood by the user.
Signed-off-by: John Snow <address@hidden>
---
nbd/server.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/nbd/server.c b/nbd/server.c
index 0910d09a6d..de21c64ce3 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",
--
2.17.2
- Re: [Qemu-block] [PATCH v3 04/10] block/dirty-bitmap: change semantics of enabled predicate, (continued)
- [Qemu-block] [PATCH v3 08/10] block/dirty-bitmaps: move comment block, John Snow, 2019/02/22
- [Qemu-block] [PATCH v3 09/10] blockdev: remove unused paio parameter documentation, John Snow, 2019/02/22
- [Qemu-block] [PATCH v3 06/10] block/dirty-bitmap: explicitly lock bitmaps with successors, John Snow, 2019/02/22
- [Qemu-block] [PATCH v3 05/10] nbd: change error checking order for bitmaps,
John Snow <=
- [Qemu-block] [PATCH v3 10/10] iotests: add busy/recording bit test to 124, John Snow, 2019/02/22
- [Qemu-block] [PATCH v3 07/10] block/dirty-bitmaps: unify qmp_locked and user_locked calls, John Snow, 2019/02/22
- [Qemu-block] [PATCH v3 03/10] block/dirty-bitmap: remove set/reset assertions against enabled bit, John Snow, 2019/02/22