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 <vsement...@yandex-team.ru> Signed-off-by: Fiona Ebner <f.eb...@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