qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 8/9] mirror: return the remaining dirty bytes upon query


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [PATCH 8/9] mirror: return the remaining dirty bytes upon query
Date: Wed, 1 Mar 2023 19:31:53 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

On 24.02.23 17:48, Fiona Ebner wrote:
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),

Doesn't it duplicate info->len - info->offset in meaning?

      };
  }
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:

--
Best regards,
Vladimir




reply via email to

[Prev in Thread] Current Thread [Next in Thread]