From nobody Sun Apr 28 16:42:54 2024 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 1549297631617382.0455064703501; Mon, 4 Feb 2019 08:27:11 -0800 (PST) Received: from localhost ([127.0.0.1]:45352 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqh5Q-00025V-IG for importer@patchew.org; Mon, 04 Feb 2019 11:27:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqh2G-0007Xz-Ov for qemu-devel@nongnu.org; Mon, 04 Feb 2019 11:23:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gqgoX-0002gL-0F for qemu-devel@nongnu.org; Mon, 04 Feb 2019 11:09:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45132) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gqgoV-0002fc-Vx; Mon, 04 Feb 2019 11:09:40 -0500 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 mx1.redhat.com (Postfix) with ESMTPS id 00880C058CB0; Mon, 4 Feb 2019 16:09:39 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-162.phx2.redhat.com [10.3.116.162]) by smtp.corp.redhat.com (Postfix) with ESMTP id D19996ACFF; Mon, 4 Feb 2019 16:09:34 +0000 (UTC) From: Eric Blake To: qemu-devel@nongnu.org Date: Mon, 4 Feb 2019 10:09:28 -0600 Message-Id: <20190204160928.11209-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 04 Feb 2019 16:09:39 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] 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: Fam Zheng , Kevin Wolf , vsementsov@virtuozzo.com, qemu-block@nongnu.org, Markus Armbruster , Max Reitz , andrey.shinkevich@virtuozzo.com, jsnow@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" 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. Signed-off-by: Eric Blake Reviewed-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy --- qapi/block-core.json | 5 ++++- block/dirty-bitmap.c | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index dae5c7b4d83..2e0bd3c245a 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' } } ## # @Qcow2BitmapInfoFlags: diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c index 00ea36f5545..e46f72b346c 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; --=20 2.20.1