From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99C93C433E0 for ; Tue, 16 Mar 2021 17:09:10 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 298FF6511E for ; Tue, 16 Mar 2021 17:09:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 298FF6511E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:45902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMDBt-0006YW-8R for qemu-devel@archiver.kernel.org; Tue, 16 Mar 2021 13:09:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48874) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMCt7-0002qk-Rd for qemu-devel@nongnu.org; Tue, 16 Mar 2021 12:49:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:31908) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lMCt5-0006kW-O8 for qemu-devel@nongnu.org; Tue, 16 Mar 2021 12:49:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615913381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Z+nD0sBjY1SnOHXkOag+NQNCw+8PogSNKp3w8NwhPRg=; b=hNuV8uIowfAgY9LEL1FXme+cMZeATHWGvZ7FFpA8XxpYTN2BMLCDGKTWg5meAZjmfbqejw CL6VEwOLlmdhgir/wej7mPUB05zxNdzIbcgEaGFpVLR94ce8gL/sKxF2BreNZmK0NMOhsh e3JnLp8e3TkE3w7Q4yXMvuCOoAdwhAI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-597-XRx7bLqkPlKgW0nif1NC3g-1; Tue, 16 Mar 2021 12:49:40 -0400 X-MC-Unique: XRx7bLqkPlKgW0nif1NC3g-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 32FA81054F93; Tue, 16 Mar 2021 16:49:38 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-185.ams2.redhat.com [10.36.115.185]) by smtp.corp.redhat.com (Postfix) with ESMTP id 41D985C1A1; Tue, 16 Mar 2021 16:49:16 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 12/13] block: remove 'dirty-bitmaps' field from 'BlockInfo' struct Date: Tue, 16 Mar 2021 16:43:54 +0000 Message-Id: <20210316164355.150519-13-berrange@redhat.com> In-Reply-To: <20210316164355.150519-1-berrange@redhat.com> References: <20210316164355.150519-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=berrange@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=216.205.24.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Fam Zheng , "Michael S. Tsirkin" , libvir-list@redhat.com, Mark Cave-Ayland , Gerd Hoffmann , qemu-block@nongnu.org, Juan Quintela , Markus Armbruster , Wainer dos Santos Moschetta , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Artyom Tarasenko , Laurent Vivier , Thomas Huth , Eduardo Habkost , Richard Henderson , "Dr. David Alan Gilbert" , Greg Kurz , Cleber Rosa , John Snow , David Gibson , Kevin Wolf , Vladimir Sementsov-Ogievskiy , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Max Reitz , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The same data is available in the 'BlockDeviceInfo' struct. Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Daniel P. Berrangé --- block/qapi.c | 5 ----- docs/system/deprecated.rst | 13 ------------- docs/system/removed-features.rst | 9 +++++++++ qapi/block-core.json | 11 +---------- tests/qemu-iotests/194 | 4 ++-- tests/qemu-iotests/236 | 2 +- tests/qemu-iotests/246 | 3 ++- tests/qemu-iotests/254 | 2 +- tests/qemu-iotests/260 | 5 +++-- .../tests/migrate-bitmaps-postcopy-test | 6 ++++-- 10 files changed, 23 insertions(+), 37 deletions(-) diff --git a/block/qapi.c b/block/qapi.c index 3acc118c44..943e7b15ad 100644 --- a/block/qapi.c +++ b/block/qapi.c @@ -383,11 +383,6 @@ static void bdrv_query_info(BlockBackend *blk, BlockInfo **p_info, info->io_status = blk_iostatus(blk); } - if (bs && !QLIST_EMPTY(&bs->dirty_bitmaps)) { - info->has_dirty_bitmaps = true; - info->dirty_bitmaps = bdrv_query_dirty_bitmaps(bs); - } - if (bs && bs->drv) { info->has_inserted = true; info->inserted = bdrv_block_device_info(blk, bs, false, errp); diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst index b1b487256a..f6d0b16579 100644 --- a/docs/system/deprecated.rst +++ b/docs/system/deprecated.rst @@ -199,19 +199,6 @@ Use arguments ``base-node`` and ``top-node`` instead. Specify the properties for the object as top-level arguments instead. -``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. - -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. - ``nbd-server-add`` and ``nbd-server-remove`` (since 5.2) '''''''''''''''''''''''''''''''''''''''''''''''''''''''' diff --git a/docs/system/removed-features.rst b/docs/system/removed-features.rst index 67526f1dd9..eb4b71750c 100644 --- a/docs/system/removed-features.rst +++ b/docs/system/removed-features.rst @@ -120,6 +120,15 @@ The ``status`` field of the ``BlockDirtyInfo`` structure, returned by these commands is removed. Two new boolean fields, ``recording`` and ``busy`` effectively replace it. +``query-block`` result field ``dirty-bitmaps`` (removed in 6.0) +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +The ``dirty-bitmaps`` field of the ``BlockInfo`` structure, returned by +the query-block command is itself now removed. 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. + Human Monitor Protocol (HMP) commands ------------------------------------- diff --git a/qapi/block-core.json b/qapi/block-core.json index 2a0c345c2c..0399449e13 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -539,9 +539,6 @@ # @tray_open: True if the device's tray is open # (only present if it has a tray) # -# @dirty-bitmaps: dirty bitmaps information (only present if the -# driver has one or more dirty bitmaps) (Since 2.0) -# # @io-status: @BlockDeviceIoStatus. Only present if the device # supports it and the VM is configured to stop on errors # (supported device models: virtio-blk, IDE, SCSI except @@ -550,18 +547,12 @@ # @inserted: @BlockDeviceInfo describing the device if media is # present # -# Features: -# @deprecated: Member @dirty-bitmaps is deprecated. Use @inserted -# member @dirty-bitmaps instead. -# # Since: 0.14 ## { 'struct': 'BlockInfo', 'data': {'device': 'str', '*qdev': 'str', 'type': 'str', 'removable': 'bool', 'locked': 'bool', '*inserted': 'BlockDeviceInfo', - '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus', - '*dirty-bitmaps': { 'type': ['BlockDirtyInfo'], - 'features': [ 'deprecated' ] } } } + '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus' } } ## # @BlockMeasureInfo: diff --git a/tests/qemu-iotests/194 b/tests/qemu-iotests/194 index 3889266afa..e44b8df728 100755 --- a/tests/qemu-iotests/194 +++ b/tests/qemu-iotests/194 @@ -95,7 +95,7 @@ with iotests.FilePath('source.img') as source_img_path, \ iotests.log(event, filters=[iotests.filter_qmp_event]) iotests.log('Check bitmaps on source:') - iotests.log(source_vm.qmp('query-block')['return'][0]['dirty-bitmaps']) + iotests.log(source_vm.qmp('query-block')['return'][0]['inserted']['dirty-bitmaps']) iotests.log('Check bitmaps on target:') - iotests.log(dest_vm.qmp('query-block')['return'][0]['dirty-bitmaps']) + iotests.log(dest_vm.qmp('query-block')['return'][0]['inserted']['dirty-bitmaps']) diff --git a/tests/qemu-iotests/236 b/tests/qemu-iotests/236 index f6c44517d6..20419bbb9e 100755 --- a/tests/qemu-iotests/236 +++ b/tests/qemu-iotests/236 @@ -39,7 +39,7 @@ overwrite = [("0xab", "0", "64k"), # Full overwrite def query_bitmaps(vm): res = vm.qmp("query-block") - return { "bitmaps": { device['device']: device.get('dirty-bitmaps', []) for + return { "bitmaps": { device['device']: device.get('inserted', {}).get('dirty-bitmaps', []) for device in res['return'] } } with iotests.FilePath('img') as img_path, \ diff --git a/tests/qemu-iotests/246 b/tests/qemu-iotests/246 index fa3102c546..5932a0e8a9 100755 --- a/tests/qemu-iotests/246 +++ b/tests/qemu-iotests/246 @@ -30,7 +30,8 @@ gran_large = 128 * 1024 def query_bitmaps(vm): res = vm.qmp("query-block") - return { "bitmaps": { device['device']: device.get('dirty-bitmaps', []) for + return { "bitmaps": { device['device']: device.get('inserted', {}) + .get('dirty-bitmaps', []) for device in res['return'] } } with iotests.FilePath('img') as img_path, \ diff --git a/tests/qemu-iotests/254 b/tests/qemu-iotests/254 index 49da948407..108bf5f894 100755 --- a/tests/qemu-iotests/254 +++ b/tests/qemu-iotests/254 @@ -73,7 +73,7 @@ vm.qmp_log('transaction', indent=2, actions=[ result = vm.qmp('query-block')['return'][0] log("query-block: device = {}, node-name = {}, dirty-bitmaps:".format( result['device'], result['inserted']['node-name'])) -log(result['dirty-bitmaps'], indent=2) +log(result['inserted']['dirty-bitmaps'], indent=2) log("\nbitmaps in backing image:") log(result['inserted']['image']['backing-image']['format-specific'] \ ['data']['bitmaps'], indent=2) diff --git a/tests/qemu-iotests/260 b/tests/qemu-iotests/260 index a35cb7b61f..2ec64a9b99 100755 --- a/tests/qemu-iotests/260 +++ b/tests/qemu-iotests/260 @@ -32,8 +32,9 @@ size = 64 * 1024 * 3 def print_bitmap(msg, vm): result = vm.qmp('query-block')['return'][0] - if 'dirty-bitmaps' in result: - bitmap = result['dirty-bitmaps'][0] + info = result.get("inserted", {}) + if 'dirty-bitmaps' in info: + bitmap = info['dirty-bitmaps'][0] log('{}: name={} dirty-clusters={}'.format(msg, bitmap['name'], bitmap['count'] // 64 // 1024)) else: diff --git a/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test b/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test index dbf10e58d3..d046ebeb94 100755 --- a/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test +++ b/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test @@ -67,10 +67,12 @@ def event_dist(e1, e2): def check_bitmaps(vm, count): result = vm.qmp('query-block') + info = result['return'][0].get('inserted', {}) + if count == 0: - assert 'dirty-bitmaps' not in result['return'][0] + assert 'dirty-bitmaps' not in info else: - assert len(result['return'][0]['dirty-bitmaps']) == count + assert len(info['dirty-bitmaps']) == count class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase): -- 2.30.2