From nobody Mon Feb 9 01:26:54 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; dkim=fail; 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 1537368639397575.878157058588; Wed, 19 Sep 2018 07:50:39 -0700 (PDT) Received: from localhost ([::1]:45763 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g2doM-00015u-7L for importer@patchew.org; Wed, 19 Sep 2018 10:50:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45338) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g2dmG-0008E2-RI for qemu-devel@nongnu.org; Wed, 19 Sep 2018 10:48:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g2dmC-0000Im-Kd for qemu-devel@nongnu.org; Wed, 19 Sep 2018 10:48:28 -0400 Received: from fanzine.igalia.com ([91.117.99.155]:56747) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g2dmC-0000Eq-2X; Wed, 19 Sep 2018 10:48:24 -0400 Received: from [194.100.51.2] (helo=perseus.local) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1g2dm9-0003dH-DK; Wed, 19 Sep 2018 16:48:21 +0200 Received: from berto by perseus.local with local (Exim 4.89) (envelope-from ) id 1g2dlt-0004Tn-Sj; Wed, 19 Sep 2018 17:48:05 +0300 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=References:In-Reply-To:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=ShFJku5U+sCMMWdihuZTwaLKOZtU9d2x2+PwRNid/Kk=; b=e8npZQi/RkfbBl96gKU2Lz9xi05+TqJ06MAi7PRvaQoXCz+G2ZoZRw04UPNqjJkWayeGy5PVwNmha8U13+lgT4Yx6WhOIExU+O1HmPPhf6X1yLKsMPHs3aGCztIZtH82uVK67PVEHEJHJUvk4NJv5NhBvFqK3a4PLtScMQfhRCv2nSB1HCCfgREElRTSYsXZ192EzMLGWrm6DbUuu5YOV5e4aLs//1kubWePQh9MFhJXN4Abj2WnGOvNqslCaz3ujhGwaFv3H1pQK5TFQQbhbPFHah0QtibEyikjuOEkG619ouEI01Cd0NQvmaTjySpcWLzPFoC+t0QJ9m1wcNj30g==; From: Alberto Garcia To: qemu-devel@nongnu.org Date: Wed, 19 Sep 2018 17:47:46 +0300 Message-Id: <8f8a151dae565027208268ed8d120e4612ef5f9f.1537367701.git.berto@igalia.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 91.117.99.155 Subject: [Qemu-devel] [PATCH 08/14] block: Use bdrv_reopen_set_read_only() in external_snapshot_commit() 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 , Alberto Garcia , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This patch replaces the bdrv_reopen() calls that set and remove the BDRV_O_RDWR flag with the new bdrv_reopen_set_read_only() function. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- blockdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/blockdev.c b/blockdev.c index 58e057b0d9..2f2359593e 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1701,8 +1701,7 @@ static void external_snapshot_commit(BlkActionState *= common) * bdrv_reopen_multiple() across all the entries at once, because we * don't want to abort all of them if one of them fails the reopen */ if (!atomic_read(&state->old_bs->copy_on_read)) { - bdrv_reopen(state->old_bs, state->old_bs->open_flags & ~BDRV_O_RDW= R, - NULL); + bdrv_reopen_set_read_only(state->old_bs, true, NULL); } =20 aio_context_release(aio_context); --=20 2.11.0