From nobody Tue Feb 10 12:45:09 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.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 208.118.235.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 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528309778253883.2190216859524; Wed, 6 Jun 2018 11:29:38 -0700 (PDT) Received: from localhost ([::1]:53962 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQdBg-0007gZ-M7 for importer@patchew.org; Wed, 06 Jun 2018 14:29:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57551) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQd7B-0004QS-OX for qemu-devel@nongnu.org; Wed, 06 Jun 2018 14:24:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fQd7A-0002sj-NQ for qemu-devel@nongnu.org; Wed, 06 Jun 2018 14:24:57 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:59040 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fQd78-0002qf-8G; Wed, 06 Jun 2018 14:24:54 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D332140BC073; Wed, 6 Jun 2018 18:24:53 +0000 (UTC) Received: from probe.bos.redhat.com (dhcp-17-177.bos.redhat.com [10.18.17.177]) by smtp.corp.redhat.com (Postfix) with ESMTP id 63B87202660D; Wed, 6 Jun 2018 18:24:53 +0000 (UTC) From: John Snow To: qemu-block@nongnu.org, qemu-devel@nongnu.org Date: Wed, 6 Jun 2018 14:24:49 -0400 Message-Id: <20180606182449.1607-6-jsnow@redhat.com> In-Reply-To: <20180606182449.1607-1-jsnow@redhat.com> References: <20180606182449.1607-1-jsnow@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 06 Jun 2018 18:24:53 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 06 Jun 2018 18:24:53 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jsnow@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v2 5/5] qapi: add disabled parameter to block-dirty-bitmap-add 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: Kevin Wolf , Vladimir Sementsov-Ogievskiy , Fam Zheng , Markus Armbruster , Max Reitz , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy This is needed, for example, to create a new bitmap and merge several disabled bitmaps into a new one. Without this flag we will have to put block-dirty-bitmap-add and block-dirty-bitmap-disable into one transaction. Signed-off-by: Vladimir Sementsov-Ogievskiy Signed-off-by: John Snow Reviewed-by: Jeff Cody --- blockdev.c | 10 ++++++++++ qapi/block-core.json | 6 +++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/blockdev.c b/blockdev.c index dc40a358b0..041f5d594f 100644 --- a/blockdev.c +++ b/blockdev.c @@ -2073,6 +2073,7 @@ static void block_dirty_bitmap_add_prepare(BlkActionS= tate *common, action->has_granularity, action->granularit= y, action->has_persistent, action->persistent, action->has_autoload, action->autoload, + action->has_x_disabled, action->x_disabled, &local_err); =20 if (!local_err) { @@ -2880,6 +2881,7 @@ void qmp_block_dirty_bitmap_add(const char *node, con= st char *name, bool has_granularity, uint32_t granularity, bool has_persistent, bool persistent, bool has_autoload, bool autoload, + bool has_disabled, bool disabled, Error **errp) { BlockDriverState *bs; @@ -2914,6 +2916,10 @@ void qmp_block_dirty_bitmap_add(const char *node, co= nst char *name, warn_report("Autoload option is deprecated and its value is ignore= d"); } =20 + if (!has_disabled) { + disabled =3D false; + } + if (persistent && !bdrv_can_store_new_dirty_bitmap(bs, name, granularity, errp)) { @@ -2925,6 +2931,10 @@ void qmp_block_dirty_bitmap_add(const char *node, co= nst char *name, return; } =20 + if (disabled) { + bdrv_disable_dirty_bitmap(bitmap); + } + bdrv_dirty_bitmap_set_persistance(bitmap, persistent); } =20 diff --git a/qapi/block-core.json b/qapi/block-core.json index 9d4ab93190..fff23fc82b 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -1734,11 +1734,15 @@ # Currently, all dirty tracking bitmaps are loaded from Qcow2 on # open. # +# @x-disabled: the bitmap is created in the disabled state, which means th= at +# it will not track drive changes. The bitmap may be enabled = with +# x-block-dirty-bitmap-enable. Default is false. (Since: 3.0) +# # Since: 2.4 ## { 'struct': 'BlockDirtyBitmapAdd', 'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32', - '*persistent': 'bool', '*autoload': 'bool' } } + '*persistent': 'bool', '*autoload': 'bool', '*x-disabled': 'bo= ol' } } =20 ## # @BlockDirtyBitmapMerge: --=20 2.14.3