From nobody Sun Feb 8 14:10:16 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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=1615830710; cv=none; d=zohomail.com; s=zohoarc; b=gyc/nXVtrI5+Iow7j86f1rGwWF6jU+KhZ5eGy5OV5ackCylV8YiakVpBa9/DQclXJUeWke9wzw+thgEYy9CTX4Yn4KIqRrM/jgpcmCKlTiYD1EHos69v6j0GocNG+TrADhzA+959JkGHHHjvAuIc9dn59fHzfSCM/674tUyfnIQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615830710; h=Content-Type: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; bh=Z+nD0sBjY1SnOHXkOag+NQNCw+8PogSNKp3w8NwhPRg=; b=Er/ejhYeR/m8eU5EnJ1cQ6w/7AfdFT+2vMcAxMoCVTnog6IwCW7Nwqcf8segA0ua0YnoXQJlbvKQunCO/a3yUBBzXt6SqmNjuoAphKX1vtEIjxmKB0BoqNj0Xk83wFoPke+Pk1y5MLwtEBy5ZPm6MX5+26EnBgdc3PMyeO15A/g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 16158307108261009.4843904294323; Mon, 15 Mar 2021 10:51:50 -0700 (PDT) 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-467-7Y_JUL7vODy1vu8dDQQK0g-1; Mon, 15 Mar 2021 13:51:46 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2A8B687A831; Mon, 15 Mar 2021 17:51:40 +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 EC23D5D75A; Mon, 15 Mar 2021 17:51:39 +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 ADF6D57DC1; Mon, 15 Mar 2021 17:51:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12FHpcWe006329 for ; Mon, 15 Mar 2021 13:51:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id D07CC1037EBB; Mon, 15 Mar 2021 17:51:38 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-81.ams2.redhat.com [10.36.115.81]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E962100239A; Mon, 15 Mar 2021 17:51:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615830709; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Z+nD0sBjY1SnOHXkOag+NQNCw+8PogSNKp3w8NwhPRg=; b=OU58KZFU3w0FJypSsFv8JwMiXq2h5amD/rbFWaFPkF2TotnX0hirEpKYUFgp+bJnktp3aQ tc2E+RJjrwXLVccMHyYjGwHhETnJAATnrTxRxvn4ld+S8Tq5/05LfoIqXB8aBWWAlZcVqO YEyhgjj0UdUyMreFZEQ10oJAmu68LFA= X-MC-Unique: 7Y_JUL7vODy1vu8dDQQK0g-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 12/13] block: remove 'dirty-bitmaps' field from 'BlockInfo' struct Date: Mon, 15 Mar 2021 17:45:22 +0000 Message-Id: <20210315174523.979666-13-berrange@redhat.com> In-Reply-To: <20210315174523.979666-1-berrange@redhat.com> References: <20210315174523.979666-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Fam Zheng , "Michael S. Tsirkin" , libvir-list@redhat.com, Mark Cave-Ayland , Gerd Hoffmann , qemu-block@nongnu.org, Juan Quintela , Wainer dos Santos Moschetta , Marcel Apfelbaum , =?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 , Max Reitz , qemu-ppc@nongnu.org, Paolo Bonzini 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) The same data is available in the 'BlockDeviceInfo' struct. Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Daniel P. Berrang=C3=A9 --- 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, BlockIn= fo **p_info, info->io_status =3D blk_iostatus(blk); } =20 - if (bs && !QLIST_EMPTY(&bs->dirty_bitmaps)) { - info->has_dirty_bitmaps =3D true; - info->dirty_bitmaps =3D bdrv_query_dirty_bitmaps(bs); - } - if (bs && bs->drv) { info->has_inserted =3D true; info->inserted =3D 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. =20 Specify the properties for the object as top-level arguments instead. =20 -``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. - ``nbd-server-add`` and ``nbd-server-remove`` (since 5.2) '''''''''''''''''''''''''''''''''''''''''''''''''''''''' =20 diff --git a/docs/system/removed-features.rst b/docs/system/removed-feature= s.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`` structu= re, returned by these commands is removed. Two new boolean fields, ``recording`` and ``busy`` effectively replace it. =20 +``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 t= he +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 ------------------------------------- =20 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': 'b= ool', 'locked': 'bool', '*inserted': 'BlockDeviceInfo', - '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus', - '*dirty-bitmaps': { 'type': ['BlockDirtyInfo'], - 'features': [ 'deprecated' ] } } } + '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus' } } =20 ## # @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=3D[iotests.filter_qmp_event]) =20 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']['dir= ty-bitmaps']) =20 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 =3D [("0xab", "0", "64k"), # Full overw= rite =20 def query_bitmaps(vm): res =3D 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'] } } =20 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 =3D 128 * 1024 =20 def query_bitmaps(vm): res =3D 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'] } } =20 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=3D2, actions=3D[ result =3D vm.qmp('query-block')['return'][0] log("query-block: device =3D {}, node-name =3D {}, dirty-bitmaps:".format( result['device'], result['inserted']['node-name'])) -log(result['dirty-bitmaps'], indent=3D2) +log(result['inserted']['dirty-bitmaps'], indent=3D2) log("\nbitmaps in backing image:") log(result['inserted']['image']['backing-image']['format-specific'] \ ['data']['bitmaps'], indent=3D2) 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 =3D 64 * 1024 * 3 =20 def print_bitmap(msg, vm): result =3D vm.qmp('query-block')['return'][0] - if 'dirty-bitmaps' in result: - bitmap =3D result['dirty-bitmaps'][0] + info =3D result.get("inserted", {}) + if 'dirty-bitmaps' in info: + bitmap =3D info['dirty-bitmaps'][0] log('{}: name=3D{} dirty-clusters=3D{}'.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 =3D vm.qmp('query-block') =20 + info =3D result['return'][0].get('inserted', {}) + if count =3D=3D 0: - assert 'dirty-bitmaps' not in result['return'][0] + assert 'dirty-bitmaps' not in info else: - assert len(result['return'][0]['dirty-bitmaps']) =3D=3D count + assert len(info['dirty-bitmaps']) =3D=3D count =20 =20 class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase): --=20 2.30.2