From nobody Mon Feb 9 13:05:00 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 1542032067321606.713681835561; Mon, 12 Nov 2018 06:14:27 -0800 (PST) Received: from localhost ([::1]:48852 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMCyv-0007Hb-Qn for importer@patchew.org; Mon, 12 Nov 2018 09:14:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58025) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMCmy-0000yK-2w for qemu-devel@nongnu.org; Mon, 12 Nov 2018 09:02:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gMCmw-0001ih-6w for qemu-devel@nongnu.org; Mon, 12 Nov 2018 09:02:03 -0500 Received: from fanzine.igalia.com ([91.117.99.155]:57678) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gMCmt-0001Fv-0k; Mon, 12 Nov 2018 09:02:00 -0500 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 1gMCmA-00074A-SZ; Mon, 12 Nov 2018 15:01:15 +0100 Received: from berto by perseus.local with local (Exim 4.89) (envelope-from ) id 1gMClq-0007Cd-Co; Mon, 12 Nov 2018 16:00:54 +0200 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=sQCxV5wyx+HLUIM978YCa6OcSm59PAfxWWc62jb/wwM=; b=sFfPlbE6eILUuFYbtTu0ptE+1w9FtDb9NdW8WTALkF0p+W/pXa2RfjDm5Zvja5L/l/q9pLfJQCyJBwlaSIkjK64PICXoGq6cFiYHszjzyU4gjsJEcjJEThTcOFFrcmPbyADVuGKGggybo9U+iwG/Lw86dP/PnRR4QEsdRhdvdikXQg/imIaTlmVOAr57uFfyhxNhdXEoSg5kVrMIC+wxZ3t4F0raWEaYWIquxalQZ3trjdHdxKuBg6mrnJp4u85/Rhnw9TCciOW6reqihRu8pRGr60HPjVZQqDaSYSSvpCmi3cxvRoSy/6XC7sGV3+vA/3+9b78S/TEp3xsROCqkeQ==; From: Alberto Garcia To: qemu-devel@nongnu.org Date: Mon, 12 Nov 2018 16:00:39 +0200 Message-Id: <35768d725ca22f3599157e70d17960f998ac9a56.1542031058.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 v5 07/16] 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) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This patch replaces the bdrv_reopen() call 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 20d1d84bab..112bc62ae5 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1703,8 +1703,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