From nobody Tue Nov 11 22:40:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1565998610; cv=none; d=zoho.com; s=zohoarc; b=Cnck22D/VCz7VhJU5bwQ8Pf5iCjyHOIhLFXAkSptpXe3QbefvhDN008Qub/pcTsUI1Y8yaIIMTqyCmTwaWVJ78dzY1le3AKL2FcCyCl1dYzX5pig//HZe2rUqEsm3vZAxeozStcXcQz0I2FgKCN+JPYplFp7hd/diq0pklW+ctE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565998610; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=vJLAB/wkO8ez6YNJa2saRo9LHwcMKLluhwXLCwmqwm4=; b=Pl2rJSw614OOEpXm4mD5Z+e5IxyxZCpWsM4byue51tAo/VNq59oRhSeV5ZSwaBMv/beomXAPZtX/n9nEQTj0ezvYuPJMUsO29OkeZHmLIJ12XYGz38XkYXJk89Oe96ohfuspWRzvusloJcirRiwwlUAnfVGSgo1V3J/F5MBP0/I= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1565998610657273.34197455797107; Fri, 16 Aug 2019 16:36:50 -0700 (PDT) Received: from localhost ([::1]:33376 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hylm4-0003BG-Jd for importer@patchew.org; Fri, 16 Aug 2019 19:36:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47139) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hylQ1-00073H-24 for qemu-devel@nongnu.org; Fri, 16 Aug 2019 19:14:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hylPz-0006L5-OI for qemu-devel@nongnu.org; Fri, 16 Aug 2019 19:14:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46978) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hylPu-0006Da-BN; Fri, 16 Aug 2019 19:13:56 -0400 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 87BFA86668; Fri, 16 Aug 2019 23:13:53 +0000 (UTC) Received: from probe.bos.redhat.com (dhcp-17-187.bos.redhat.com [10.18.17.187]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8374319C6A; Fri, 16 Aug 2019 23:13:52 +0000 (UTC) From: John Snow To: qemu-devel@nongnu.org Date: Fri, 16 Aug 2019 19:13:15 -0400 Message-Id: <20190816231318.8650-34-jsnow@redhat.com> In-Reply-To: <20190816231318.8650-1-jsnow@redhat.com> References: <20190816231318.8650-1-jsnow@redhat.com> MIME-Version: 1.0 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.26]); Fri, 16 Aug 2019 23:13:53 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 33/36] qapi: add dirty-bitmaps to query-named-block-nodes result X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Vladimir Sementsov-Ogievskiy , jsnow@redhat.com, qemu-stable@nongnu.org, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" 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 Signed-off-by: John Snow Message-id: 20190717173937.18747-1-jsnow@redhat.com [Added deprecation information. --js] Signed-off-by: John Snow [Fixed spelling --js] --- 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 917435f0226..15f10302647 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 d72cf5f354b..e9364a4a293 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 BlockDeviceInfo 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 f7680c08e10..00a4b6f3504 100644 --- a/qemu-deprecated.texi +++ b/qemu-deprecated.texi @@ -154,6 +154,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