From nobody Fri Oct 3 15:49:19 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 (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552077797370818.3547603529491; Fri, 8 Mar 2019 12:43:17 -0800 (PST) Received: from localhost ([127.0.0.1]:49654 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2MKm-0003Z6-7o for importer@patchew.org; Fri, 08 Mar 2019 15:43:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44856) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2M7J-0000rZ-G8 for qemu-devel@nongnu.org; Fri, 08 Mar 2019 15:29:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2M7G-0006ur-RL for qemu-devel@nongnu.org; Fri, 08 Mar 2019 15:29:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55654) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h2M7F-0006pw-As for qemu-devel@nongnu.org; Fri, 08 Mar 2019 15:29:14 -0500 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 mx1.redhat.com (Postfix) with ESMTPS id 29E423082DDD; Fri, 8 Mar 2019 20:29:10 +0000 (UTC) Received: from probe.bos.redhat.com (dhcp-17-160.bos.redhat.com [10.18.17.160]) by smtp.corp.redhat.com (Postfix) with ESMTP id AF79719492; Fri, 8 Mar 2019 20:29:09 +0000 (UTC) From: John Snow To: qemu-devel@nongnu.org Date: Fri, 8 Mar 2019 15:28:53 -0500 Message-Id: <20190308202858.26636-13-jsnow@redhat.com> In-Reply-To: <20190308202858.26636-1-jsnow@redhat.com> References: <20190308202858.26636-1-jsnow@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Fri, 08 Mar 2019 20:29:10 +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 12/17] block/dirty-bitmap: add inconsistent status 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" Even though the status field is deprecated, we still have to support it for a few more releases. Since this is a very new kind of bitmap state, it makes sense for it to have its own status field. Reviewed-by: Eric Blake Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Message-id: 20190301191545.8728-3-jsnow@redhat.com Signed-off-by: John Snow --- qapi/block-core.json | 7 ++++++- block/dirty-bitmap.c | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index e639ef6d1c..ae55cd0704 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -442,10 +442,15 @@ # recording new writes. If the bitmap was @disabled, it is not # recording new writes. (Since 2.12) # +# @inconsistent: This is a persistent dirty bitmap that was marked in-use = on +# disk, and is unusable by QEMU. It can only be deleted. +# Please rely on the inconsistent field in @BlockDirtyInfo +# instead, as the status field is deprecated. (Since 4.0) +# # Since: 2.4 ## { 'enum': 'DirtyBitmapStatus', - 'data': ['active', 'disabled', 'frozen', 'locked'] } + 'data': ['active', 'disabled', 'frozen', 'locked', 'inconsistent'] } =20 ## # @BlockDirtyInfo: diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c index c611bfb971..987ea7ca29 100644 --- a/block/dirty-bitmap.c +++ b/block/dirty-bitmap.c @@ -209,10 +209,15 @@ bool bdrv_dirty_bitmap_enabled(BdrvDirtyBitmap *bitma= p) * or it can be Disabled and not recording writes. * (4) Locked: Whether Active or Disabled, the user cannot modify this b= itmap * in any way from the monitor. + * (5) Inconsistent: This is a persistent bitmap whose "in use" bit is set= , and + * is unusable by QEMU. It can be deleted to remove it f= rom + * the qcow2. */ DirtyBitmapStatus bdrv_dirty_bitmap_status(BdrvDirtyBitmap *bitmap) { - if (bdrv_dirty_bitmap_has_successor(bitmap)) { + if (bdrv_dirty_bitmap_inconsistent(bitmap)) { + return DIRTY_BITMAP_STATUS_INCONSISTENT; + } else if (bdrv_dirty_bitmap_has_successor(bitmap)) { return DIRTY_BITMAP_STATUS_FROZEN; } else if (bdrv_dirty_bitmap_busy(bitmap)) { return DIRTY_BITMAP_STATUS_LOCKED; --=20 2.17.2