From patchwork Wed Sep 19 14:47:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alberto Garcia X-Patchwork-Id: 10605983 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6769E14BD for ; Wed, 19 Sep 2018 14:50:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4CFDA2C1A2 for ; Wed, 19 Sep 2018 14:50:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B0C52C34B; Wed, 19 Sep 2018 14:50:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E73462C3CC for ; Wed, 19 Sep 2018 14:50:03 +0000 (UTC) Received: from localhost ([::1]:45763 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g2dnn-00015u-7q for patchwork-qemu-devel@patchwork.kernel.org; Wed, 19 Sep 2018 10:50:03 -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 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==; 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 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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_RDWR, - NULL); + bdrv_reopen_set_read_only(state->old_bs, true, NULL); } aio_context_release(aio_context);