[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 11/19] block/dirty-bitmaps: fix merge permissions
From: |
John Snow |
Subject: |
[Qemu-devel] [PULL 11/19] block/dirty-bitmaps: fix merge permissions |
Date: |
Mon, 29 Oct 2018 17:24:53 -0400 |
In prior commits that made merge transactionable, we removed the
assertion that merge cannot operate on disabled bitmaps. In addition,
we want to make sure that we are prohibiting merges to "locked" bitmaps.
Use the new user_locked function to check.
Reported-by: Eric Blake <address@hidden>
Signed-off-by: John Snow <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Message-id: address@hidden
Signed-off-by: John Snow <address@hidden>
---
block/dirty-bitmap.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c
index 9603cdd29b..bfccb0ea15 100644
--- a/block/dirty-bitmap.c
+++ b/block/dirty-bitmap.c
@@ -806,9 +806,9 @@ void bdrv_merge_dirty_bitmap(BdrvDirtyBitmap *dest, const
BdrvDirtyBitmap *src,
qemu_mutex_lock(dest->mutex);
- if (bdrv_dirty_bitmap_frozen(dest)) {
- error_setg(errp, "Bitmap '%s' is frozen and cannot be modified",
- dest->name);
+ if (bdrv_dirty_bitmap_user_locked(dest)) {
+ error_setg(errp, "Bitmap '%s' is currently in use by another"
+ " operation and cannot be modified", dest->name);
goto out;
}
--
2.14.5
- [Qemu-devel] [PULL 05/19] blockdev: rename block-dirty-bitmap-clear transaction handlers, (continued)
- [Qemu-devel] [PULL 05/19] blockdev: rename block-dirty-bitmap-clear transaction handlers, John Snow, 2018/10/29
- [Qemu-devel] [PULL 02/19] dirty-bitmap: switch assert-fails to errors in bdrv_merge_dirty_bitmap, John Snow, 2018/10/29
- [Qemu-devel] [PULL 07/19] iotests: 169: drop deprecated 'autoload' parameter, John Snow, 2018/10/29
- [Qemu-devel] [PULL 06/19] qapi: add transaction support for x-block-dirty-bitmap-merge, John Snow, 2018/10/29
- [Qemu-devel] [PULL 08/19] block/qcow2: improve error message in qcow2_inactivate, John Snow, 2018/10/29
- [Qemu-devel] [PULL 04/19] dirty-bitmap: make it possible to restore bitmap after merge, John Snow, 2018/10/29
- [Qemu-devel] [PULL 09/19] bloc/qcow2: drop dirty_bitmaps_loaded state variable, John Snow, 2018/10/29
- [Qemu-devel] [PULL 10/19] block/dirty-bitmaps: add user_locked status checker, John Snow, 2018/10/29
- [Qemu-devel] [PULL 13/19] block/dirty-bitmaps: prohibit enable/disable on locked/frozen bitmaps, John Snow, 2018/10/29
- [Qemu-devel] [PULL 12/19] block/dirty-bitmaps: allow clear on disabled bitmaps, John Snow, 2018/10/29
- [Qemu-devel] [PULL 11/19] block/dirty-bitmaps: fix merge permissions,
John Snow <=
- [Qemu-devel] [PULL 18/19] iotests: improve 169, John Snow, 2018/10/29
- [Qemu-devel] [PULL 19/19] iotests: 169: add cases for source vm resuming, John Snow, 2018/10/29
- [Qemu-devel] [PULL 15/19] nbd: forbid use of frozen bitmaps, John Snow, 2018/10/29
- [Qemu-devel] [PULL 14/19] block/backup: prohibit backup from using in use bitmaps, John Snow, 2018/10/29
- [Qemu-devel] [PULL 16/19] bitmap: Update count after a merge, John Snow, 2018/10/29
- [Qemu-devel] [PULL 17/19] dirty-bitmaps: clean-up bitmaps loading and migration logic, John Snow, 2018/10/29
- Re: [Qemu-devel] [PULL 00/19] Bitmaps patches, Peter Maydell, 2018/10/30