* [Qemu-devel] [PATCH v2] dirty-bitmap: Expose persistent flag to 'query-block'
@ 2019-02-04 21:05 Eric Blake
2019-02-04 22:42 ` John Snow
0 siblings, 1 reply; 2+ messages in thread
From: Eric Blake @ 2019-02-04 21:05 UTC (permalink / raw)
To: qemu-devel
Cc: jsnow, qemu-block, andrey.shinkevich, vsementsov, Fam Zheng,
Kevin Wolf, Max Reitz, Markus Armbruster
Since qemu currently doesn't flush persistent bitmaps to disk until
shutdown (which might be MUCH later), it's useful if 'query-block'
at least shows WHICH bitmaps will (eventually) make it to persistent
storage. Update affected iotests.
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: John Snow <jsnow@redhat.com>
---
v2: also update iotest output [John]; R-b added since changes only to tests
---
qapi/block-core.json | 5 ++++-
block/dirty-bitmap.c | 1 +
tests/qemu-iotests/124 | 1 +
tests/qemu-iotests/236.out | 14 ++++++++++++++
4 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 5f17d67d714..f2bfe566d8d 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -447,11 +447,14 @@
#
# @status: current status of the dirty bitmap (since 2.4)
#
+# @persistent: true if the bitmap will eventually be flushed to persistent
+# storage (since 4.0)
+#
# Since: 1.3
##
{ 'struct': 'BlockDirtyInfo',
'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32',
- 'status': 'DirtyBitmapStatus'} }
+ 'status': 'DirtyBitmapStatus', 'persistent': 'bool' } }
##
# @BlockLatencyHistogramInfo:
diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c
index 00ea36f5545..e46f72b346c 100644
--- a/block/dirty-bitmap.c
+++ b/block/dirty-bitmap.c
@@ -440,6 +440,7 @@ BlockDirtyInfoList *bdrv_query_dirty_bitmaps(BlockDriverState *bs)
info->has_name = !!bm->name;
info->name = g_strdup(bm->name);
info->status = bdrv_dirty_bitmap_status(bm);
+ info->persistent = bm->persistent;
entry->value = info;
*plist = entry;
plist = &entry->next;
diff --git a/tests/qemu-iotests/124 b/tests/qemu-iotests/124
index 9f189e3b540..5aa1bf1bd64 100755
--- a/tests/qemu-iotests/124
+++ b/tests/qemu-iotests/124
@@ -350,6 +350,7 @@ class TestIncrementalBackup(TestIncrementalBackupBase):
self.assert_qmp(result, 'return[0]/dirty-bitmaps[0]/count', 458752)
self.assert_qmp(result, 'return[0]/dirty-bitmaps[0]/granularity', 65536)
self.assert_qmp(result, 'return[0]/dirty-bitmaps[0]/status', 'active')
+ self.assert_qmp(result, 'return[0]/dirty-bitmaps[0]/persistent', False)
# Prepare a cluster_size=128k backup target without a backing file.
(target, _) = bitmap0.new_target()
diff --git a/tests/qemu-iotests/236.out b/tests/qemu-iotests/236.out
index bb2d71ea5ec..5006f7bca16 100644
--- a/tests/qemu-iotests/236.out
+++ b/tests/qemu-iotests/236.out
@@ -25,12 +25,14 @@ write -P0xcd 0x3ff0000 64k
"count": 262144,
"granularity": 65536,
"name": "bitmapB",
+ "persistent": false,
"status": "active"
},
{
"count": 262144,
"granularity": 65536,
"name": "bitmapA",
+ "persistent": false,
"status": "active"
}
]
@@ -85,12 +87,14 @@ write -P0xcd 0x3ff0000 64k
"count": 262144,
"granularity": 65536,
"name": "bitmapB",
+ "persistent": false,
"status": "active"
},
{
"count": 262144,
"granularity": 65536,
"name": "bitmapA",
+ "persistent": false,
"status": "active"
}
]
@@ -183,18 +187,21 @@ write -P0xea 0x3fe0000 64k
"count": 393216,
"granularity": 65536,
"name": "bitmapC",
+ "persistent": false,
"status": "disabled"
},
{
"count": 262144,
"granularity": 65536,
"name": "bitmapB",
+ "persistent": false,
"status": "disabled"
},
{
"count": 458752,
"granularity": 65536,
"name": "bitmapA",
+ "persistent": false,
"status": "disabled"
}
]
@@ -247,18 +254,21 @@ write -P0xea 0x3fe0000 64k
"count": 393216,
"granularity": 65536,
"name": "bitmapC",
+ "persistent": false,
"status": "disabled"
},
{
"count": 262144,
"granularity": 65536,
"name": "bitmapB",
+ "persistent": false,
"status": "disabled"
},
{
"count": 458752,
"granularity": 65536,
"name": "bitmapA",
+ "persistent": false,
"status": "disabled"
}
]
@@ -304,24 +314,28 @@ write -P0xea 0x3fe0000 64k
"count": 458752,
"granularity": 65536,
"name": "bitmapD",
+ "persistent": false,
"status": "disabled"
},
{
"count": 393216,
"granularity": 65536,
"name": "bitmapC",
+ "persistent": false,
"status": "disabled"
},
{
"count": 262144,
"granularity": 65536,
"name": "bitmapB",
+ "persistent": false,
"status": "disabled"
},
{
"count": 458752,
"granularity": 65536,
"name": "bitmapA",
+ "persistent": false,
"status": "disabled"
}
]
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH v2] dirty-bitmap: Expose persistent flag to 'query-block'
2019-02-04 21:05 [Qemu-devel] [PATCH v2] dirty-bitmap: Expose persistent flag to 'query-block' Eric Blake
@ 2019-02-04 22:42 ` John Snow
0 siblings, 0 replies; 2+ messages in thread
From: John Snow @ 2019-02-04 22:42 UTC (permalink / raw)
To: Eric Blake, qemu-devel
Cc: qemu-block, andrey.shinkevich, vsementsov, Fam Zheng, Kevin Wolf,
Max Reitz, Markus Armbruster
On 2/4/19 4:05 PM, Eric Blake wrote:
> Since qemu currently doesn't flush persistent bitmaps to disk until
> shutdown (which might be MUCH later), it's useful if 'query-block'
> at least shows WHICH bitmaps will (eventually) make it to persistent
> storage. Update affected iotests.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>
> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> Reviewed-by: John Snow <jsnow@redhat.com>
staged, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-02-04 22:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-04 21:05 [Qemu-devel] [PATCH v2] dirty-bitmap: Expose persistent flag to 'query-block' Eric Blake
2019-02-04 22:42 ` John Snow
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).