Add possibility to merge allocation map of specified node into target
bitmap.
Signed-off-by: Vladimir Sementsov-Ogievskiy<vsementsov@virtuozzo.com>
---
qapi/block-core.json | 31 +++++++++++++++++--
include/block/block_int.h | 4 +++
block/dirty-bitmap.c | 42 +++++++++++++++++++++++++
block/monitor/bitmap-qmp-cmds.c | 55 ++++++++++++++++++++++++++++-----
4 files changed, 122 insertions(+), 10 deletions(-)
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 6d227924d0..0fafb043bc 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -2006,6 +2006,32 @@
'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32',
'*persistent': 'bool', '*disabled': 'bool' } }
+##
+# @AllocationMapMode:
+#
+# An enumeration of possible allocation maps that could be merged into target
+# bitmap.
+#
+# @top: The allocation status of the top layer of the attached storage node.
+#
+# Since: 6.1
+##
+{ 'enum': 'AllocationMapMode',
+ 'data': ['top'] }
+
+##
+# @BlockDirtyBitmapMergeExternalSource:
+#
+# @node: name of device/node which the bitmap is tracking
+#
+# @name: name of the dirty bitmap
+#
+# Since: 6.1
+##
+{ 'struct': 'BlockDirtyBitmapMergeExternalSource',
+ 'data': { 'node': 'str', '*name': 'str',
+ '*allocation-map': 'AllocationMapMode' } }
+
##
# @BlockDirtyBitmapMergeSource:
#
@@ -2017,7 +2043,7 @@
##
{ 'alternate': 'BlockDirtyBitmapMergeSource',
'data': { 'local': 'str',
- 'external': 'BlockDirtyBitmap' } }
+ 'external': 'BlockDirtyBitmapMergeExternalSource' } }
##
# @BlockDirtyBitmapMerge:
@@ -2176,7 +2202,8 @@
#
##
{ 'command': 'block-dirty-bitmap-merge',
- 'data': 'BlockDirtyBitmapMerge' }
+ 'data': 'BlockDirtyBitmapMerge',
+ 'coroutine': true }
##