From nobody Mon Feb 9 02:13:33 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1616059883; cv=none; d=zohomail.com; s=zohoarc; b=iFLDP3b+YzP+WRJYZ1K6or7zlcyUFA1Y7P17UbW/kLAKY0LmRjVez/KBwoZOewLUb7jsq98DB4WLlATdoPwZIYQdU41ZsK3ZSkKGH5CH9+ifJQB8QT4xW6Ib/x6Z8w0uMHE7j4ax/a3wtjpZ4n9G3E8vHswX6WzybDmqHGH66uw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616059883; 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=tZjK5InZ3EXD0maVDHC9kQTXNLmEi/MZBQqAomULPJc=; b=CH9XE0BXBRm1/ZpsiNPgIGjmf+bSHYvSnkEcLeApPSVHXJwN9eojpIBWNHdd4U4b+opie5N9z8OwJzGOrnoeU4VVUCQvt/4akEKShzTvur8+De4ChqrX5G48HwVW7rJKY2sQxIp4NRI0e474yPRgGodTdSVtn5YURHneNzP57ww= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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 [170.10.133.124]) by mx.zohomail.com with SMTPS id 1616059883224616.4422842210274; Thu, 18 Mar 2021 02:31:23 -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-4-i7oR_1x6Nz-P3wowoZnZ2Q-1; Thu, 18 Mar 2021 05:31:20 -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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id DC32D5B361; Thu, 18 Mar 2021 09:31:13 +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 8950D19726; Thu, 18 Mar 2021 09:31:13 +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 D5E534BB7C; Thu, 18 Mar 2021 09:31:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12I9VBo6006986 for ; Thu, 18 Mar 2021 05:31:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4F44266A16; Thu, 18 Mar 2021 09:31:11 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-61.ams2.redhat.com [10.36.115.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E46862951; Thu, 18 Mar 2021 09:30:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616059882; 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=tZjK5InZ3EXD0maVDHC9kQTXNLmEi/MZBQqAomULPJc=; b=XhYBAhk3ziLaoW1ExyrXXA7YjRHG/LWWIRFKwktD7AYw37R+95p0dnKRKSuIx3wjmlwv1Q WrrRAGSqAWuiQBRr2GzvNTt1kXgsyK1lBGnWEP+scBEVJhWFKz3qg+uJjpzC4rvFyO0Aeb 0vrAHJ3VyWiKpHXWs6VCk+aEDskZ9jc= X-MC-Unique: i7oR_1x6Nz-P3wowoZnZ2Q-1 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: Thu, 18 Mar 2021 09:25:11 +0000 Message-Id: <20210318092512.250725-13-berrange@redhat.com> In-Reply-To: <20210318092512.250725-1-berrange@redhat.com> References: <20210318092512.250725-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.84 on 10.5.11.23 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 eadba0f288..c7e80fa731 100644 --- a/docs/system/deprecated.rst +++ b/docs/system/deprecated.rst @@ -198,19 +198,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 47fdfe6f72..d164d3f290 100644 --- a/docs/system/removed-features.rst +++ b/docs/system/removed-features.rst @@ -127,6 +127,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