From patchwork Tue Jul 16 01:13:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Snow X-Patchwork-Id: 1132392 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45nj8y6ycjz9sLt for ; Tue, 16 Jul 2019 11:14:07 +1000 (AEST) Received: from localhost ([::1]:44694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hnC2b-0005RZ-6P for incoming@patchwork.ozlabs.org; Mon, 15 Jul 2019 21:14:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56747) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hnC2U-0005Mj-UC for qemu-devel@nongnu.org; Mon, 15 Jul 2019 21:13:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hnC2T-0003SB-Nk for qemu-devel@nongnu.org; Mon, 15 Jul 2019 21:13:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44338) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hnC2R-0003Qu-1G; Mon, 15 Jul 2019 21:13:51 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 263CEC057F2F; Tue, 16 Jul 2019 01:13:50 +0000 (UTC) Received: from probe.bos.redhat.com (dhcp-17-130.bos.redhat.com [10.18.17.130]) by smtp.corp.redhat.com (Postfix) with ESMTP id B79F46085B; Tue, 16 Jul 2019 01:13:44 +0000 (UTC) From: John Snow To: qemu-block@nongnu.org, qemu-devel@nongnu.org Date: Mon, 15 Jul 2019 21:13:44 -0400 Message-Id: <20190716011344.25380-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 16 Jul 2019 01:13:50 +0000 (UTC) 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] [PATCH v2] 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: Kevin Wolf , Vladimir Sementsov-Ogievskiy , libvir-list@redhat.com, John Snow , Markus Armbruster , Max Reitz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 and feature flag information. --js] Signed-off-by: John Snow --- block/qapi.c | 5 +++++ qapi/block-core.json | 14 +++++++++++++- qemu-deprecated.texi | 12 ++++++++++++ 3 files changed, 30 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 *blk, info->backing_file = g_strdup(bs->backing_file); } + if (!QLIST_EMPTY(&bs->dirty_bitmaps)) { + info->has_dirty_bitmaps = true; + info->dirty_bitmaps = bdrv_query_dirty_bitmaps(bs); + } + info->detect_zeroes = bs->detect_zeroes; 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..0d67dd245c 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -360,6 +360,16 @@ # @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) +# +# Features: +# @node-dirty-bitmaps: Signals the capability to return dirty bitmap information +# per-node instead of per-drive. If this flag is present, +# dirty-bitmaps should not be read from the BlockInfo +# structure, the top-level data for query-block. +# (Since 4.2) +# # Since: 0.14.0 # ## @@ -378,7 +388,8 @@ '*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': 'BlockdevCacheInfo', - 'write_threshold': 'int' } } + 'write_threshold': 'int', '*dirty-bitmaps': ['BlockDirtyInfo'] }, + 'features': [ { 'name': 'node-dirty-bitmaps' } ] } ## # @BlockDeviceIoStatus: @@ -656,6 +667,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..bc4e5ac1d7 100644 --- a/qemu-deprecated.texi +++ b/qemu-deprecated.texi @@ -134,6 +134,18 @@ The ``status'' field of the ``BlockDirtyInfo'' structure, returned by the query-block command is deprecated. Two new boolean fields, ``recording'' and ``busy'' effectively replace it. +@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 the +type of the ``inserted`` field in query-block replies, as well as the +type of array items in query-named-block-nodes. + +In the absence of bitmaps on either structure, management APIs may use the +presence of the ``node-dirty-bitmaps`` feature flag on the ``BlockDeviceInfo`` +structure to know where to anticipate bitmap data when present. + @subsection query-cpus (since 2.12.0) The ``query-cpus'' command is replaced by the ``query-cpus-fast'' command.