Blame SOURCES/kvm-block-dirty-bitmap-add-inconsistent-status.patch

7711c0
From 615fbb1d8b28619f0a6a00cdaaa57d223670bf92 Mon Sep 17 00:00:00 2001
7711c0
From: John Snow <jsnow@redhat.com>
7711c0
Date: Wed, 3 Apr 2019 18:18:50 +0200
7711c0
Subject: [PATCH 145/163] block/dirty-bitmap: add inconsistent status
7711c0
7711c0
RH-Author: John Snow <jsnow@redhat.com>
7711c0
Message-id: <20190403181857.9693-15-jsnow@redhat.com>
7711c0
Patchwork-id: 85411
7711c0
O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH 14/21] block/dirty-bitmap: add inconsistent status
7711c0
Bugzilla: 1677073
7711c0
RH-Acked-by: Max Reitz <mreitz@redhat.com>
7711c0
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
7711c0
RH-Acked-by: Sergio Lopez Pascual <slp@redhat.com>
7711c0
7711c0
Even though the status field is deprecated, we still have to support
7711c0
it for a few more releases. Since this is a very new kind of bitmap
7711c0
state, it makes sense for it to have its own status field.
7711c0
7711c0
Reviewed-by: Eric Blake <eblake@redhat.com>
7711c0
Signed-off-by: John Snow <jsnow@redhat.com>
7711c0
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
7711c0
Message-id: 20190301191545.8728-3-jsnow@redhat.com
7711c0
Signed-off-by: John Snow <jsnow@redhat.com>
7711c0
(cherry picked from commit 0064cfefa4e90c11e394befb7abe47602f2f30d7)
7711c0
Signed-off-by: John Snow <jsnow@redhat.com>
7711c0
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
7711c0
---
7711c0
 block/dirty-bitmap.c | 7 ++++++-
7711c0
 qapi/block-core.json | 7 ++++++-
7711c0
 2 files changed, 12 insertions(+), 2 deletions(-)
7711c0
7711c0
diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c
7711c0
index 096c1b7..4a2349d 100644
7711c0
--- a/block/dirty-bitmap.c
7711c0
+++ b/block/dirty-bitmap.c
7711c0
@@ -210,10 +210,15 @@ bool bdrv_dirty_bitmap_enabled(BdrvDirtyBitmap *bitmap)
7711c0
  *               or it can be Disabled and not recording writes.
7711c0
  * (4) Locked:   Whether Active or Disabled, the user cannot modify this bitmap
7711c0
  *               in any way from the monitor.
7711c0
+ * (5) Inconsistent: This is a persistent bitmap whose "in use" bit is set, and
7711c0
+ *                   is unusable by QEMU. It can be deleted to remove it from
7711c0
+ *                   the qcow2.
7711c0
  */
7711c0
 DirtyBitmapStatus bdrv_dirty_bitmap_status(BdrvDirtyBitmap *bitmap)
7711c0
 {
7711c0
-    if (bdrv_dirty_bitmap_has_successor(bitmap)) {
7711c0
+    if (bdrv_dirty_bitmap_inconsistent(bitmap)) {
7711c0
+        return DIRTY_BITMAP_STATUS_INCONSISTENT;
7711c0
+    } else if (bdrv_dirty_bitmap_has_successor(bitmap)) {
7711c0
         return DIRTY_BITMAP_STATUS_FROZEN;
7711c0
     } else if (bdrv_dirty_bitmap_busy(bitmap)) {
7711c0
         return DIRTY_BITMAP_STATUS_LOCKED;
7711c0
diff --git a/qapi/block-core.json b/qapi/block-core.json
7711c0
index 92a42ef..c84144d 100644
7711c0
--- a/qapi/block-core.json
7711c0
+++ b/qapi/block-core.json
7711c0
@@ -443,10 +443,15 @@
7711c0
 #          recording new writes. If the bitmap was @disabled, it is not
7711c0
 #          recording new writes. (Since 2.12)
7711c0
 #
7711c0
+# @inconsistent: This is a persistent dirty bitmap that was marked in-use on
7711c0
+#                disk, and is unusable by QEMU. It can only be deleted.
7711c0
+#                Please rely on the inconsistent field in @BlockDirtyInfo
7711c0
+#                instead, as the status field is deprecated. (Since 4.0)
7711c0
+#
7711c0
 # Since: 2.4
7711c0
 ##
7711c0
 { 'enum': 'DirtyBitmapStatus',
7711c0
-  'data': ['active', 'disabled', 'frozen', 'locked'] }
7711c0
+  'data': ['active', 'disabled', 'frozen', 'locked', 'inconsistent'] }
7711c0
 
7711c0
 ##
7711c0
 # @BlockDirtyInfo:
7711c0
-- 
7711c0
1.8.3.1
7711c0