From nobody Sun Nov 9 14:51:27 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1550687054794543.378142111738; Wed, 20 Feb 2019 10:24:14 -0800 (PST) Received: from localhost ([127.0.0.1]:45329 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gwWXT-0008Ke-Ow for importer@patchew.org; Wed, 20 Feb 2019 13:24:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55264) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gwWBX-00089y-TO for qemu-devel@nongnu.org; Wed, 20 Feb 2019 13:01:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gwWBN-0004b1-Nd for qemu-devel@nongnu.org; Wed, 20 Feb 2019 13:01:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40370) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gwWBK-0004Z8-F3 for qemu-devel@nongnu.org; Wed, 20 Feb 2019 13:01:19 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DEAC51FCFDB; Wed, 20 Feb 2019 18:01:16 +0000 (UTC) Received: from probe.bos.redhat.com (dhcp-17-92.bos.redhat.com [10.18.17.92]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5420C18B96; Wed, 20 Feb 2019 18:01:16 +0000 (UTC) From: John Snow To: qemu-devel@nongnu.org Date: Wed, 20 Feb 2019 13:01:10 -0500 Message-Id: <20190220180112.28250-2-jsnow@redhat.com> In-Reply-To: <20190220180112.28250-1-jsnow@redhat.com> References: <20190220180112.28250-1-jsnow@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 20 Feb 2019 18:01:16 +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] [PULL v2 1/3] dirty-bitmap: Expose persistent flag to 'query-block' X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, jsnow@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Eric Blake Since qemu currently doesn't flush persistent bitmaps to disk until shutdown (which might be MUCH later), it's useful if 'query-block' at least shows WHICH bitmaps will (eventually) make it to persistent storage. Update affected iotests. Signed-off-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow Message-id: 20190204210512.27458-1-eblake@redhat.com Signed-off-by: John Snow --- block/dirty-bitmap.c | 1 + qapi/block-core.json | 5 ++++- tests/qemu-iotests/124 | 1 + tests/qemu-iotests/236.out | 14 ++++++++++++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c index 00ea36f554..e46f72b346 100644 --- a/block/dirty-bitmap.c +++ b/block/dirty-bitmap.c @@ -440,6 +440,7 @@ BlockDirtyInfoList *bdrv_query_dirty_bitmaps(BlockDrive= rState *bs) info->has_name =3D !!bm->name; info->name =3D g_strdup(bm->name); info->status =3D bdrv_dirty_bitmap_status(bm); + info->persistent =3D bm->persistent; entry->value =3D info; *plist =3D entry; plist =3D &entry->next; diff --git a/qapi/block-core.json b/qapi/block-core.json index ee1ab7a8a2..b8c8e04d02 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -450,11 +450,14 @@ # # @status: current status of the dirty bitmap (since 2.4) # +# @persistent: true if the bitmap will eventually be flushed to persistent +# storage (since 4.0) +# # Since: 1.3 ## { 'struct': 'BlockDirtyInfo', 'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32', - 'status': 'DirtyBitmapStatus'} } + 'status': 'DirtyBitmapStatus', 'persistent': 'bool' } } =20 ## # @Qcow2BitmapInfoFlags: diff --git a/tests/qemu-iotests/124 b/tests/qemu-iotests/124 index 9f189e3b54..5aa1bf1bd6 100755 --- a/tests/qemu-iotests/124 +++ b/tests/qemu-iotests/124 @@ -350,6 +350,7 @@ class TestIncrementalBackup(TestIncrementalBackupBase): self.assert_qmp(result, 'return[0]/dirty-bitmaps[0]/count', 458752) self.assert_qmp(result, 'return[0]/dirty-bitmaps[0]/granularity', = 65536) self.assert_qmp(result, 'return[0]/dirty-bitmaps[0]/status', 'acti= ve') + self.assert_qmp(result, 'return[0]/dirty-bitmaps[0]/persistent', F= alse) =20 # Prepare a cluster_size=3D128k backup target without a backing fi= le. (target, _) =3D bitmap0.new_target() diff --git a/tests/qemu-iotests/236.out b/tests/qemu-iotests/236.out index bb2d71ea5e..5006f7bca1 100644 --- a/tests/qemu-iotests/236.out +++ b/tests/qemu-iotests/236.out @@ -25,12 +25,14 @@ write -P0xcd 0x3ff0000 64k "count": 262144, "granularity": 65536, "name": "bitmapB", + "persistent": false, "status": "active" }, { "count": 262144, "granularity": 65536, "name": "bitmapA", + "persistent": false, "status": "active" } ] @@ -85,12 +87,14 @@ write -P0xcd 0x3ff0000 64k "count": 262144, "granularity": 65536, "name": "bitmapB", + "persistent": false, "status": "active" }, { "count": 262144, "granularity": 65536, "name": "bitmapA", + "persistent": false, "status": "active" } ] @@ -183,18 +187,21 @@ write -P0xea 0x3fe0000 64k "count": 393216, "granularity": 65536, "name": "bitmapC", + "persistent": false, "status": "disabled" }, { "count": 262144, "granularity": 65536, "name": "bitmapB", + "persistent": false, "status": "disabled" }, { "count": 458752, "granularity": 65536, "name": "bitmapA", + "persistent": false, "status": "disabled" } ] @@ -247,18 +254,21 @@ write -P0xea 0x3fe0000 64k "count": 393216, "granularity": 65536, "name": "bitmapC", + "persistent": false, "status": "disabled" }, { "count": 262144, "granularity": 65536, "name": "bitmapB", + "persistent": false, "status": "disabled" }, { "count": 458752, "granularity": 65536, "name": "bitmapA", + "persistent": false, "status": "disabled" } ] @@ -304,24 +314,28 @@ write -P0xea 0x3fe0000 64k "count": 458752, "granularity": 65536, "name": "bitmapD", + "persistent": false, "status": "disabled" }, { "count": 393216, "granularity": 65536, "name": "bitmapC", + "persistent": false, "status": "disabled" }, { "count": 262144, "granularity": 65536, "name": "bitmapB", + "persistent": false, "status": "disabled" }, { "count": 458752, "granularity": 65536, "name": "bitmapA", + "persistent": false, "status": "disabled" } ] --=20 2.17.2