From nobody Mon Apr 29 01:11:41 2024 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1503495903540772.2660856532625; Wed, 23 Aug 2017 06:45:03 -0700 (PDT) Received: from localhost ([::1]:43793 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkVxu-0005bK-5U for importer@patchew.org; Wed, 23 Aug 2017 09:45:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52977) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkVvv-0004IQ-KW for qemu-devel@nongnu.org; Wed, 23 Aug 2017 09:43:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkVvu-0001wq-PU for qemu-devel@nongnu.org; Wed, 23 Aug 2017 09:42:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42668) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dkVvs-0001vN-OZ; Wed, 23 Aug 2017 09:42:56 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 95CC97EA99; Wed, 23 Aug 2017 13:42:55 +0000 (UTC) Received: from lemon.redhat.com (ovpn-12-53.pek2.redhat.com [10.72.12.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 644885C473; Wed, 23 Aug 2017 13:42:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 95CC97EA99 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=famz@redhat.com From: Fam Zheng To: qemu-devel@nongnu.org Date: Wed, 23 Aug 2017 21:42:39 +0800 Message-Id: <20170823134242.12080-2-famz@redhat.com> In-Reply-To: <20170823134242.12080-1-famz@redhat.com> References: <20170823134242.12080-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 23 Aug 2017 13:42:55 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH for-2.10 1/4] block-backend: Refactor inactivate check 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 , qemu-block@nongnu.org, stefanha@redhat.com, Max Reitz 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" The logic will be fixed (extended), move it to a separete function. Signed-off-by: Fam Zheng Reviewed-by: Stefan Hajnoczi --- block/block-backend.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/block/block-backend.c b/block/block-backend.c index e9798e897d..a3984d2bec 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -192,6 +192,19 @@ static void blk_root_activate(BdrvChild *child, Error = **errp) } } =20 +static bool blk_can_inactivate(BlockBackend *blk) +{ + /* Only inactivate BlockBackends for guest devices (which are inactive= at + * this point because the VM is stopped) and unattached monitor-owned + * BlockBackends. If there is still any other user like a block job, t= hen + * we simply can't inactivate the image. */ + if (blk->dev || blk_name(blk)[0]) { + return true; + } + + return false; +} + static int blk_root_inactivate(BdrvChild *child) { BlockBackend *blk =3D child->opaque; @@ -200,11 +213,7 @@ static int blk_root_inactivate(BdrvChild *child) return 0; } =20 - /* Only inactivate BlockBackends for guest devices (which are inactive= at - * this point because the VM is stopped) and unattached monitor-owned - * BlockBackends. If there is still any other user like a block job, t= hen - * we simply can't inactivate the image. */ - if (!blk->dev && !blk_name(blk)[0]) { + if (!blk_can_inactivate(blk)) { return -EPERM; } =20 --=20 2.13.5 From nobody Mon Apr 29 01:11:41 2024 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1503495917335235.24860766495624; Wed, 23 Aug 2017 06:45:17 -0700 (PDT) Received: from localhost ([::1]:43794 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkVy7-0005q8-UJ for importer@patchew.org; Wed, 23 Aug 2017 09:45:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53070) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkVw4-0004Qk-JL for qemu-devel@nongnu.org; Wed, 23 Aug 2017 09:43:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkVw3-00020O-M0 for qemu-devel@nongnu.org; Wed, 23 Aug 2017 09:43:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38874) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dkVvw-0001xA-AD; Wed, 23 Aug 2017 09:43:00 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4776337E88; Wed, 23 Aug 2017 13:42:59 +0000 (UTC) Received: from lemon.redhat.com (ovpn-12-53.pek2.redhat.com [10.72.12.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5DC5A7E22F; Wed, 23 Aug 2017 13:42:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4776337E88 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=famz@redhat.com From: Fam Zheng To: qemu-devel@nongnu.org Date: Wed, 23 Aug 2017 21:42:40 +0800 Message-Id: <20170823134242.12080-3-famz@redhat.com> In-Reply-To: <20170823134242.12080-1-famz@redhat.com> References: <20170823134242.12080-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 23 Aug 2017 13:42:59 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH for-2.10 2/4] block-backend: Allow more "can inactivate" cases 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 , qemu-block@nongnu.org, stefanha@redhat.com, Max Reitz 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" These two conditions corresponds to mirror job's source and target, which need to be allowed as they are part of the non-shared storage migration workflow: failing to inactivate either will result in a failure during migration completion. Signed-off-by: Fam Zheng Reviewed-by: Stefan Hajnoczi --- block/block-backend.c | 21 ++++++++++++++++----- include/sysemu/block-backend.h | 1 + 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/block/block-backend.c b/block/block-backend.c index a3984d2bec..48f5356657 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -70,6 +70,7 @@ struct BlockBackend { =20 int quiesce_counter; VMChangeStateEntry *vmsh; + bool force_allow_inactivate; }; =20 typedef struct BlockBackendAIOCB { @@ -192,17 +193,27 @@ static void blk_root_activate(BdrvChild *child, Error= **errp) } } =20 +void blk_set_force_allow_inactivate(BlockBackend *blk) +{ + blk->force_allow_inactivate =3D true; +} + static bool blk_can_inactivate(BlockBackend *blk) { - /* Only inactivate BlockBackends for guest devices (which are inactive= at - * this point because the VM is stopped) and unattached monitor-owned - * BlockBackends. If there is still any other user like a block job, t= hen - * we simply can't inactivate the image. */ + /* If it is a guest device, inactivate is ok. */ if (blk->dev || blk_name(blk)[0]) { return true; } =20 - return false; + /* Inactivating means no more write to the image can be done, even if = it's + * guest invisible change. For block job BBs that satisfy this, we can= just + * allow it. This is the case for mirror job source, which is require= d by + * libvirt non-shared block migration. */ + if (!(blk->perm & (BLK_PERM_WRITE | BLK_PERM_WRITE_UNCHANGED))) { + return true; + } + + return blk->force_allow_inactivate; } =20 static int blk_root_inactivate(BdrvChild *child) diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h index 4a3730596b..aadc733daf 100644 --- a/include/sysemu/block-backend.h +++ b/include/sysemu/block-backend.h @@ -241,5 +241,6 @@ void blk_set_io_limits(BlockBackend *blk, ThrottleConfi= g *cfg); void blk_io_limits_disable(BlockBackend *blk); void blk_io_limits_enable(BlockBackend *blk, const char *group); void blk_io_limits_update_group(BlockBackend *blk, const char *group); +void blk_set_force_allow_inactivate(BlockBackend *blk); =20 #endif --=20 2.13.5 From nobody Mon Apr 29 01:11:41 2024 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1503496033064383.31905851608565; Wed, 23 Aug 2017 06:47:13 -0700 (PDT) Received: from localhost ([::1]:43811 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkVzz-0007U2-TK for importer@patchew.org; Wed, 23 Aug 2017 09:47:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53081) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkVw5-0004RD-50 for qemu-devel@nongnu.org; Wed, 23 Aug 2017 09:43:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkVw4-00020m-E9 for qemu-devel@nongnu.org; Wed, 23 Aug 2017 09:43:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36434) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dkVvz-0001yf-Sy; Wed, 23 Aug 2017 09:43:04 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D4CFB61474; Wed, 23 Aug 2017 13:43:02 +0000 (UTC) Received: from lemon.redhat.com (ovpn-12-53.pek2.redhat.com [10.72.12.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 124807DDF1; Wed, 23 Aug 2017 13:42:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D4CFB61474 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=famz@redhat.com From: Fam Zheng To: qemu-devel@nongnu.org Date: Wed, 23 Aug 2017 21:42:41 +0800 Message-Id: <20170823134242.12080-4-famz@redhat.com> In-Reply-To: <20170823134242.12080-1-famz@redhat.com> References: <20170823134242.12080-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 23 Aug 2017 13:43:02 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH for-2.10 3/4] mirror: Mark target BB as "force allow inactivate" 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 , qemu-block@nongnu.org, stefanha@redhat.com, Max Reitz 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" Signed-off-by: Fam Zheng Reviewed-by: Stefan Hajnoczi --- block/mirror.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/block/mirror.c b/block/mirror.c index c9a6a3ca86..429751b9fe 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -1134,6 +1134,7 @@ static void mirror_start_job(const char *job_id, Bloc= kDriverState *bs, const BlockJobDriver *driver, bool is_none_mode, BlockDriverState *base, bool auto_complete, const char *filter_node_n= ame, + bool is_mirror, Error **errp) { MirrorBlockJob *s; @@ -1222,6 +1223,15 @@ static void mirror_start_job(const char *job_id, Blo= ckDriverState *bs, if (ret < 0) { goto fail; } + if (is_mirror) { + /* XXX: Mirror target could be a NBD server of target QEMU in the = case + * of non-shared block migration. To allow migration completion, we + * have to allow "inactivate" of the target BB. When that happens= , we + * know the job is drained, and the vcpus are stopped, so no write + * operation will be performed. Block layer already has assertions= to + * ensure that. */ + blk_set_force_allow_inactivate(s->target); + } =20 s->replaces =3D g_strdup(replaces); s->on_source_error =3D on_source_error; @@ -1306,7 +1316,7 @@ void mirror_start(const char *job_id, BlockDriverStat= e *bs, speed, granularity, buf_size, backing_mode, on_source_error, on_target_error, unmap, NULL, NULL, &mirror_job_driver, is_none_mode, base, false, - filter_node_name, errp); + filter_node_name, true, errp); } =20 void commit_active_start(const char *job_id, BlockDriverState *bs, @@ -1329,7 +1339,7 @@ void commit_active_start(const char *job_id, BlockDri= verState *bs, MIRROR_LEAVE_BACKING_CHAIN, on_error, on_error, true, cb, opaque, &commit_active_job_driver, false, base, auto_complete, - filter_node_name, &local_err); + filter_node_name, false, &local_err); if (local_err) { error_propagate(errp, local_err); goto error_restore_flags; --=20 2.13.5 From nobody Mon Apr 29 01:11:41 2024 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1503495975641914.3149560921825; Wed, 23 Aug 2017 06:46:15 -0700 (PDT) Received: from localhost ([::1]:43800 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkVz4-0006mk-I2 for importer@patchew.org; Wed, 23 Aug 2017 09:46:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53136) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkVw8-0004V8-M5 for qemu-devel@nongnu.org; Wed, 23 Aug 2017 09:43:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkVw7-00022G-SS for qemu-devel@nongnu.org; Wed, 23 Aug 2017 09:43:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34672) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dkVw5-000214-NP; Wed, 23 Aug 2017 09:43:09 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ABE5A3B750; Wed, 23 Aug 2017 13:43:08 +0000 (UTC) Received: from lemon.redhat.com (ovpn-12-53.pek2.redhat.com [10.72.12.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id A04DC5C473; Wed, 23 Aug 2017 13:43:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com ABE5A3B750 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=famz@redhat.com From: Fam Zheng To: qemu-devel@nongnu.org Date: Wed, 23 Aug 2017 21:42:42 +0800 Message-Id: <20170823134242.12080-5-famz@redhat.com> In-Reply-To: <20170823134242.12080-1-famz@redhat.com> References: <20170823134242.12080-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 23 Aug 2017 13:43:08 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH for-2.10 4/4] block: Update open_flags after ->inactivate() callback 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 , qemu-block@nongnu.org, stefanha@redhat.com, Max Reitz 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: Stefan Hajnoczi In the ->inactivate() callbacks, permissions are updated, which typically involves a recursive check of the whole graph. Setting BDRV_O_INACTIVE right before doing that creates a state that bdrv_is_writable() returns false, which causes permission update failure. Reorder them so the flag is updated after calling the function. Note that this doesn't break the assert in bdrv_child_cb_inactivate() because for any specific BDS, we still update its flags first before calling ->inactivate() on it one level deeper in the recursion. Signed-off-by: Fam Zheng Reviewed-by: Stefan Hajnoczi --- block.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/block.c b/block.c index 3615a6809e..3308814bba 100644 --- a/block.c +++ b/block.c @@ -4085,21 +4085,20 @@ static int bdrv_inactivate_recurse(BlockDriverState= *bs, } } =20 - if (setting_flag) { + if (setting_flag && !(bs->open_flags & BDRV_O_INACTIVE)) { uint64_t perm, shared_perm; =20 - bs->open_flags |=3D BDRV_O_INACTIVE; - QLIST_FOREACH(parent, &bs->parents, next_parent) { if (parent->role->inactivate) { ret =3D parent->role->inactivate(parent); if (ret < 0) { - bs->open_flags &=3D ~BDRV_O_INACTIVE; return ret; } } } =20 + bs->open_flags |=3D BDRV_O_INACTIVE; + /* Update permissions, they may differ for inactive nodes */ bdrv_get_cumulative_perm(bs, &perm, &shared_perm); bdrv_check_perm(bs, perm, shared_perm, NULL, &error_abort); --=20 2.13.5