Blame SOURCES/kvm-dirty-bitmap-Expose-persistent-flag-to-query-block.patch

7711c0
From 7fecc102918b8945abefa36ee01da3b707849b41 Mon Sep 17 00:00:00 2001
7711c0
From: John Snow <jsnow@redhat.com>
7711c0
Date: Wed, 3 Apr 2019 18:18:37 +0200
7711c0
Subject: [PATCH 132/163] dirty-bitmap: Expose persistent flag to 'query-block'
7711c0
7711c0
RH-Author: John Snow <jsnow@redhat.com>
7711c0
Message-id: <20190403181857.9693-2-jsnow@redhat.com>
7711c0
Patchwork-id: 85420
7711c0
O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH 01/21] dirty-bitmap: Expose persistent flag to 'query-block'
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
From: Eric Blake <eblake@redhat.com>
7711c0
7711c0
Since qemu currently doesn't flush persistent bitmaps to disk until
7711c0
shutdown (which might be MUCH later), it's useful if 'query-block'
7711c0
at least shows WHICH bitmaps will (eventually) make it to persistent
7711c0
storage.  Update affected iotests.
7711c0
7711c0
Signed-off-by: Eric Blake <eblake@redhat.com>
7711c0
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
7711c0
Reviewed-by: John Snow <jsnow@redhat.com>
7711c0
Message-id: 20190204210512.27458-1-eblake@redhat.com
7711c0
Signed-off-by: John Snow <jsnow@redhat.com>
7711c0
(cherry picked from commit f67cf661f8b88afe8a5ea2f120583924cba9087f)
7711c0
Signed-off-by: John Snow <jsnow@redhat.com>
7711c0
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
7711c0
---
7711c0
 block/dirty-bitmap.c       |  1 +
7711c0
 qapi/block-core.json       |  5 ++++-
7711c0
 tests/qemu-iotests/124     |  1 +
7711c0
 tests/qemu-iotests/236.out | 14 ++++++++++++++
7711c0
 4 files changed, 20 insertions(+), 1 deletion(-)
7711c0
7711c0
diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c
7711c0
index 00ea36f..e46f72b 100644
7711c0
--- a/block/dirty-bitmap.c
7711c0
+++ b/block/dirty-bitmap.c
7711c0
@@ -440,6 +440,7 @@ BlockDirtyInfoList *bdrv_query_dirty_bitmaps(BlockDriverState *bs)
7711c0
         info->has_name = !!bm->name;
7711c0
         info->name = g_strdup(bm->name);
7711c0
         info->status = bdrv_dirty_bitmap_status(bm);
7711c0
+        info->persistent = bm->persistent;
7711c0
         entry->value = info;
7711c0
         *plist = entry;
7711c0
         plist = &entry->next;
7711c0
diff --git a/qapi/block-core.json b/qapi/block-core.json
7711c0
index 5d6bb14..23c9462 100644
7711c0
--- a/qapi/block-core.json
7711c0
+++ b/qapi/block-core.json
7711c0
@@ -451,11 +451,14 @@
7711c0
 #
7711c0
 # @status: current status of the dirty bitmap (since 2.4)
7711c0
 #
7711c0
+# @persistent: true if the bitmap will eventually be flushed to persistent
7711c0
+#              storage (since 4.0)
7711c0
+#
7711c0
 # Since: 1.3
7711c0
 ##
7711c0
 { 'struct': 'BlockDirtyInfo',
7711c0
   'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32',
7711c0
-           'status': 'DirtyBitmapStatus'} }
7711c0
+           'status': 'DirtyBitmapStatus', 'persistent': 'bool' } }
7711c0
 
7711c0
 ##
7711c0
 # @Qcow2BitmapInfoFlags:
7711c0
diff --git a/tests/qemu-iotests/124 b/tests/qemu-iotests/124
7711c0
index 3ea4ac5..439a86a 100755
7711c0
--- a/tests/qemu-iotests/124
7711c0
+++ b/tests/qemu-iotests/124
7711c0
@@ -350,6 +350,7 @@ class TestIncrementalBackup(TestIncrementalBackupBase):
7711c0
         self.assert_qmp(result, 'return[0]/dirty-bitmaps[0]/count', 458752)
7711c0
         self.assert_qmp(result, 'return[0]/dirty-bitmaps[0]/granularity', 65536)
7711c0
         self.assert_qmp(result, 'return[0]/dirty-bitmaps[0]/status', 'active')
7711c0
+        self.assert_qmp(result, 'return[0]/dirty-bitmaps[0]/persistent', False)
7711c0
 
7711c0
         # Prepare a cluster_size=128k backup target without a backing file.
7711c0
         (target, _) = bitmap0.new_target()
7711c0
diff --git a/tests/qemu-iotests/236.out b/tests/qemu-iotests/236.out
7711c0
index bb2d71e..5006f7b 100644
7711c0
--- a/tests/qemu-iotests/236.out
7711c0
+++ b/tests/qemu-iotests/236.out
7711c0
@@ -25,12 +25,14 @@ write -P0xcd 0x3ff0000 64k
7711c0
         "count": 262144,
7711c0
         "granularity": 65536,
7711c0
         "name": "bitmapB",
7711c0
+        "persistent": false,
7711c0
         "status": "active"
7711c0
       },
7711c0
       {
7711c0
         "count": 262144,
7711c0
         "granularity": 65536,
7711c0
         "name": "bitmapA",
7711c0
+        "persistent": false,
7711c0
         "status": "active"
7711c0
       }
7711c0
     ]
7711c0
@@ -85,12 +87,14 @@ write -P0xcd 0x3ff0000 64k
7711c0
         "count": 262144,
7711c0
         "granularity": 65536,
7711c0
         "name": "bitmapB",
7711c0
+        "persistent": false,
7711c0
         "status": "active"
7711c0
       },
7711c0
       {
7711c0
         "count": 262144,
7711c0
         "granularity": 65536,
7711c0
         "name": "bitmapA",
7711c0
+        "persistent": false,
7711c0
         "status": "active"
7711c0
       }
7711c0
     ]
7711c0
@@ -183,18 +187,21 @@ write -P0xea 0x3fe0000 64k
7711c0
         "count": 393216,
7711c0
         "granularity": 65536,
7711c0
         "name": "bitmapC",
7711c0
+        "persistent": false,
7711c0
         "status": "disabled"
7711c0
       },
7711c0
       {
7711c0
         "count": 262144,
7711c0
         "granularity": 65536,
7711c0
         "name": "bitmapB",
7711c0
+        "persistent": false,
7711c0
         "status": "disabled"
7711c0
       },
7711c0
       {
7711c0
         "count": 458752,
7711c0
         "granularity": 65536,
7711c0
         "name": "bitmapA",
7711c0
+        "persistent": false,
7711c0
         "status": "disabled"
7711c0
       }
7711c0
     ]
7711c0
@@ -247,18 +254,21 @@ write -P0xea 0x3fe0000 64k
7711c0
         "count": 393216,
7711c0
         "granularity": 65536,
7711c0
         "name": "bitmapC",
7711c0
+        "persistent": false,
7711c0
         "status": "disabled"
7711c0
       },
7711c0
       {
7711c0
         "count": 262144,
7711c0
         "granularity": 65536,
7711c0
         "name": "bitmapB",
7711c0
+        "persistent": false,
7711c0
         "status": "disabled"
7711c0
       },
7711c0
       {
7711c0
         "count": 458752,
7711c0
         "granularity": 65536,
7711c0
         "name": "bitmapA",
7711c0
+        "persistent": false,
7711c0
         "status": "disabled"
7711c0
       }
7711c0
     ]
7711c0
@@ -304,24 +314,28 @@ write -P0xea 0x3fe0000 64k
7711c0
         "count": 458752,
7711c0
         "granularity": 65536,
7711c0
         "name": "bitmapD",
7711c0
+        "persistent": false,
7711c0
         "status": "disabled"
7711c0
       },
7711c0
       {
7711c0
         "count": 393216,
7711c0
         "granularity": 65536,
7711c0
         "name": "bitmapC",
7711c0
+        "persistent": false,
7711c0
         "status": "disabled"
7711c0
       },
7711c0
       {
7711c0
         "count": 262144,
7711c0
         "granularity": 65536,
7711c0
         "name": "bitmapB",
7711c0
+        "persistent": false,
7711c0
         "status": "disabled"
7711c0
       },
7711c0
       {
7711c0
         "count": 458752,
7711c0
         "granularity": 65536,
7711c0
         "name": "bitmapA",
7711c0
+        "persistent": false,
7711c0
         "status": "disabled"
7711c0
       }
7711c0
     ]
7711c0
-- 
7711c0
1.8.3.1
7711c0