From nobody Fri May 3 05:16:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563385189; cv=none; d=zoho.com; s=zohoarc; b=ArEQwAoa212bxrAJ+dQ5VwE50pza9xNayAiC5co1EdRahkARtilmbacVesv0i+nWHFUJtV8J15XsB6+hoD7vte2AiemtR/Tbwq1lc8bpfPalVcO16q4m4daYYGr9CRt7il9uHDWHl+rPqlPEKE3RUuKJ8HZnT8gO87txVIARl/A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563385189; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=K9MIVJs+uR/IoqXtkKtqxJJT7jnlUOiGFRsZ3/5uCRs=; b=mpb3ZxOhez1vqEHk5q2ZGPmc/op1VTfv5M5Olxmtmyh5BCXumpyUNpvZ6aE1QsBayF50rHK2LXVQPXWm1Gm2S9y3uauLY++mu71FuOBYbAOGxvgUCxjhmydQNjWHbJ53I/ryHCVuV+e4OUaunS8vhCTDNH8Pw64DSECKDFFWXFc= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1563385189104831.3832511835978; Wed, 17 Jul 2019 10:39:49 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4F289300CAFF; Wed, 17 Jul 2019 17:39:47 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1A8C519C68; Wed, 17 Jul 2019 17:39:47 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C71411972E; Wed, 17 Jul 2019 17:39:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x6HHdjGi030737 for ; Wed, 17 Jul 2019 13:39:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id 573E0196EE; Wed, 17 Jul 2019 17:39:45 +0000 (UTC) Received: from probe.bos.redhat.com (dhcp-17-203.bos.redhat.com [10.18.17.203]) by smtp.corp.redhat.com (Postfix) with ESMTP id EB77D19C68; Wed, 17 Jul 2019 17:39:37 +0000 (UTC) From: John Snow To: qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Wed, 17 Jul 2019 13:39:37 -0400 Message-Id: <20190717173937.18747-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Kevin Wolf , Vladimir Sementsov-Ogievskiy , libvir-list@redhat.com, John Snow , Max Reitz Subject: [libvirt] [PATCH v3] qapi: add dirty-bitmaps to query-named-block-nodes result X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Wed, 17 Jul 2019 17:39:47 +0000 (UTC) Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy Let's add a possibility to query dirty-bitmaps not only on root nodes. It is useful when dealing both with snapshots and incremental backups. Signed-off-by: Vladimir Sementsov-Ogievskiy [Added deprecation information. --js] Signed-off-by: John Snow Reviewed-by: Eric Blake --- block/qapi.c | 5 +++++ qapi/block-core.json | 6 +++++- qemu-deprecated.texi | 12 ++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/block/qapi.c b/block/qapi.c index 917435f022..15f1030264 100644 --- a/block/qapi.c +++ b/block/qapi.c @@ -79,6 +79,11 @@ BlockDeviceInfo *bdrv_block_device_info(BlockBackend *bl= k, info->backing_file =3D g_strdup(bs->backing_file); } =20 + if (!QLIST_EMPTY(&bs->dirty_bitmaps)) { + info->has_dirty_bitmaps =3D true; + info->dirty_bitmaps =3D bdrv_query_dirty_bitmaps(bs); + } + info->detect_zeroes =3D bs->detect_zeroes; =20 if (blk && blk_get_public(blk)->throttle_group_member.throttle_state) { diff --git a/qapi/block-core.json b/qapi/block-core.json index 0d43d4f37c..9210ae233d 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -360,6 +360,9 @@ # @write_threshold: configured write threshold for the device. # 0 if disabled. (Since 2.3) # +# @dirty-bitmaps: dirty bitmaps information (only present if node +# has one or more dirty bitmaps) (Since 4.2) +# # Since: 0.14.0 # ## @@ -378,7 +381,7 @@ '*bps_wr_max_length': 'int', '*iops_max_length': 'int', '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int', '*iops_size': 'int', '*group': 'str', 'cache': 'BlockdevCacheI= nfo', - 'write_threshold': 'int' } } + 'write_threshold': 'int', '*dirty-bitmaps': ['BlockDirtyInfo']= } } =20 ## # @BlockDeviceIoStatus: @@ -656,6 +659,7 @@ # # @dirty-bitmaps: dirty bitmaps information (only present if the # driver has one or more dirty bitmaps) (Since 2.0) +# Deprecated in 4.2; see BlockDirtyInfo instead. # # @io-status: @BlockDeviceIoStatus. Only present if the device # supports it and the VM is configured to stop on errors diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi index c90b08d553..6374b66546 100644 --- a/qemu-deprecated.texi +++ b/qemu-deprecated.texi @@ -134,6 +134,18 @@ The ``status'' field of the ``BlockDirtyInfo'' structu= re, returned by the query-block command is deprecated. Two new boolean fields, ``recording'' and ``busy'' effectively replace it. =20 +@subsection query-block result field dirty-bitmaps (Since 4.2) + +The ``dirty-bitmaps`` field of the ``BlockInfo`` structure, returned by +the query-block command is itself now deprecated. The ``dirty-bitmaps`` +field of the ``BlockDeviceInfo`` struct should be used instead, which is t= he +type of the ``inserted`` field in query-block replies, as well as the +type of array items in query-named-block-nodes. + +Since the ``dirty-bitmaps`` field is optionally present in both the old and +new locations, clients must use introspection to learn where to anticipate +the field if/when it does appear in command output. + @subsection query-cpus (since 2.12.0) =20 The ``query-cpus'' command is replaced by the ``query-cpus-fast'' command. --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list