[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 8/9] mirror: return the remaining dirty bytes upon query
From: |
Fiona Ebner |
Subject: |
[PATCH 8/9] mirror: return the remaining dirty bytes upon query |
Date: |
Fri, 24 Feb 2023 15:48:24 +0100 |
This can be used by management applications starting with a job in
background mode to determine when the switch to active mode should
happen.
Suggested-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
block/mirror.c | 1 +
qapi/block-core.json | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/block/mirror.c b/block/mirror.c
index 02b5bd8bd2..ac83309b82 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -1259,6 +1259,7 @@ static void mirror_query(BlockJob *job, BlockJobInfo
*info)
info->u.mirror = (BlockJobInfoMirror) {
.actively_synced = s->actively_synced,
+ .remaining_dirty = bdrv_get_dirty_count(s->dirty_bitmap),
};
}
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 07e0f30492..91594eace4 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -1308,10 +1308,12 @@
# @actively-synced: Whether the source is actively synced to the target, i.e.
# same data and new writes are done synchronously to both.
#
+# @remaining-dirty: How much of the source is dirty relative to the target.
+#
# Since 8.0
##
{ 'struct': 'BlockJobInfoMirror',
- 'data': { 'actively-synced': 'bool' } }
+ 'data': { 'actively-synced': 'bool', 'remaining-dirty': 'int64' } }
##
# @BlockJobInfo:
--
2.30.2
- [PATCH 0/9] mirror: allow switching from background to active mode, Fiona Ebner, 2023/02/24
- [PATCH 4/9] qapi/block-core: use JobType for BlockJobInfo's type, Fiona Ebner, 2023/02/24
- [PATCH 1/9] blockjob: introduce block-job-change QMP command, Fiona Ebner, 2023/02/24
- [PATCH 3/9] mirror: implement mirror_change method, Fiona Ebner, 2023/02/24
- [PATCH 2/9] block/mirror: set actively_synced even after the job is ready, Fiona Ebner, 2023/02/24
- [PATCH 5/9] qapi/block-core: turn BlockJobInfo into a union, Fiona Ebner, 2023/02/24
- [PATCH 6/9] blockjob: query driver-specific info via a new 'query' driver method, Fiona Ebner, 2023/02/24
- [PATCH 8/9] mirror: return the remaining dirty bytes upon query,
Fiona Ebner <=
- [PATCH 7/9] mirror: return mirror-specific information upon query, Fiona Ebner, 2023/02/24
- [PATCH 9/9] mirror: return the total number of bytes sent upon query, Fiona Ebner, 2023/02/24