[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 12/17] block/dirty-bitmap: add inconsistent status
From: |
John Snow |
Subject: |
[Qemu-devel] [PULL 12/17] block/dirty-bitmap: add inconsistent status |
Date: |
Fri, 8 Mar 2019 15:28:53 -0500 |
Even though the status field is deprecated, we still have to support
it for a few more releases. Since this is a very new kind of bitmap
state, it makes sense for it to have its own status field.
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: John Snow <address@hidden>
Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Message-id: address@hidden
Signed-off-by: John Snow <address@hidden>
---
qapi/block-core.json | 7 ++++++-
block/dirty-bitmap.c | 7 ++++++-
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/qapi/block-core.json b/qapi/block-core.json
index e639ef6d1c..ae55cd0704 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -442,10 +442,15 @@
# recording new writes. If the bitmap was @disabled, it is not
# recording new writes. (Since 2.12)
#
+# @inconsistent: This is a persistent dirty bitmap that was marked in-use on
+# disk, and is unusable by QEMU. It can only be deleted.
+# Please rely on the inconsistent field in @BlockDirtyInfo
+# instead, as the status field is deprecated. (Since 4.0)
+#
# Since: 2.4
##
{ 'enum': 'DirtyBitmapStatus',
- 'data': ['active', 'disabled', 'frozen', 'locked'] }
+ 'data': ['active', 'disabled', 'frozen', 'locked', 'inconsistent'] }
##
# @BlockDirtyInfo:
diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c
index c611bfb971..987ea7ca29 100644
--- a/block/dirty-bitmap.c
+++ b/block/dirty-bitmap.c
@@ -209,10 +209,15 @@ bool bdrv_dirty_bitmap_enabled(BdrvDirtyBitmap *bitmap)
* or it can be Disabled and not recording writes.
* (4) Locked: Whether Active or Disabled, the user cannot modify this bitmap
* in any way from the monitor.
+ * (5) Inconsistent: This is a persistent bitmap whose "in use" bit is set, and
+ * is unusable by QEMU. It can be deleted to remove it from
+ * the qcow2.
*/
DirtyBitmapStatus bdrv_dirty_bitmap_status(BdrvDirtyBitmap *bitmap)
{
- if (bdrv_dirty_bitmap_has_successor(bitmap)) {
+ if (bdrv_dirty_bitmap_inconsistent(bitmap)) {
+ return DIRTY_BITMAP_STATUS_INCONSISTENT;
+ } else if (bdrv_dirty_bitmap_has_successor(bitmap)) {
return DIRTY_BITMAP_STATUS_FROZEN;
} else if (bdrv_dirty_bitmap_busy(bitmap)) {
return DIRTY_BITMAP_STATUS_LOCKED;
--
2.17.2
- [Qemu-devel] [PULL 00/17] Bitmaps patches, John Snow, 2019/03/08
- [Qemu-devel] [PULL 01/17] block/dirty-bitmap: add recording and busy properties, John Snow, 2019/03/08
- [Qemu-devel] [PULL 03/17] block/dirty-bitmap: remove set/reset assertions against enabled bit, John Snow, 2019/03/08
- [Qemu-devel] [PULL 04/17] block/dirty-bitmap: change semantics of enabled predicate, John Snow, 2019/03/08
- [Qemu-devel] [PULL 02/17] block/dirty-bitmaps: rename frozen predicate helper, John Snow, 2019/03/08
- [Qemu-devel] [PULL 05/17] nbd: change error checking order for bitmaps, John Snow, 2019/03/08
- [Qemu-devel] [PULL 14/17] block/dirty-bitmaps: prohibit readonly bitmaps for backups, John Snow, 2019/03/08
- [Qemu-devel] [PULL 12/17] block/dirty-bitmap: add inconsistent status,
John Snow <=
- [Qemu-devel] [PULL 13/17] block/dirty-bitmaps: add block_dirty_bitmap_check function, John Snow, 2019/03/08
- [Qemu-devel] [PULL 06/17] block/dirty-bitmap: explicitly lock bitmaps with successors, John Snow, 2019/03/08
- [Qemu-devel] [PULL 08/17] block/dirty-bitmaps: move comment block, John Snow, 2019/03/08
- [Qemu-devel] [PULL 09/17] blockdev: remove unused paio parameter documentation, John Snow, 2019/03/08
- [Qemu-devel] [PULL 07/17] block/dirty-bitmaps: unify qmp_locked and user_locked calls, John Snow, 2019/03/08
- [Qemu-devel] [PULL 16/17] block/dirty-bitmaps: disallow busy bitmaps as merge source, John Snow, 2019/03/08
- [Qemu-devel] [PULL 15/17] block/dirty-bitmaps: prohibit removing readonly bitmaps, John Snow, 2019/03/08
- [Qemu-devel] [PULL 11/17] block/dirty-bitmaps: add inconsistent bit, John Snow, 2019/03/08
- [Qemu-devel] [PULL 10/17] iotests: add busy/recording bit test to 124, John Snow, 2019/03/08
- [Qemu-devel] [PULL 17/17] block/dirty-bitmaps: implement inconsistent bit, John Snow, 2019/03/08