From patchwork Wed Sep 14 15:52:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alberto Garcia X-Patchwork-Id: 9331913 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4ABD960231 for ; Wed, 14 Sep 2016 15:54:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C2A82A17D for ; Wed, 14 Sep 2016 15:54:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 309632A17F; Wed, 14 Sep 2016 15:54:29 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 82DBE2A17D for ; Wed, 14 Sep 2016 15:54:25 +0000 (UTC) Received: from localhost ([::1]:56949 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkCW0-0002aG-0P for patchwork-qemu-devel@patchwork.kernel.org; Wed, 14 Sep 2016 11:54:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57649) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkCVU-0002a7-8H for qemu-devel@nongnu.org; Wed, 14 Sep 2016 11:53:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkCVO-0008Iz-8u for qemu-devel@nongnu.org; Wed, 14 Sep 2016 11:53:49 -0400 Received: from smtp3.mundo-r.com ([212.51.32.191]:22044 helo=smtp4.mundo-r.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkCVO-0008DE-1C; Wed, 14 Sep 2016 11:53:46 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BuBAD9cdlX/5tjdVtdHAEBBAEBCgEBgzoBAQEBAR6BU40zlXIBAQEBAQUBgRIBkgaCD4IDhh4CgU84FAECAQEBAQEBAV4nhGICBHkQPxI8GxmITgG8NQEBCCeFaYJJh1qFEAWPIYpHiSeGLYlhhgFIkA4eNoJ/G4FSbYchAQEB X-IPAS-Result: A2BuBAD9cdlX/5tjdVtdHAEBBAEBCgEBgzoBAQEBAR6BU40zlXIBAQEBAQUBgRIBkgaCD4IDhh4CgU84FAECAQEBAQEBAV4nhGICBHkQPxI8GxmITgG8NQEBCCeFaYJJh1qFEAWPIYpHiSeGLYlhhgFIkA4eNoJ/G4FSbYchAQEB X-IronPort-AV: E=Sophos;i="5.30,334,1470693600"; d="scan'208";a="172286365" Received: from fanzine.igalia.com ([91.117.99.155]) by smtp4.mundo-r.com with ESMTP; 14 Sep 2016 17:52:42 +0200 Received: from [194.100.51.2] (helo=perseus.local) by fanzine.igalia.com with esmtpsa (Cipher TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim) id 1bkCUL-0004li-CW; Wed, 14 Sep 2016 17:52:41 +0200 Received: from berto by perseus.local with local (Exim 4.87) (envelope-from ) id 1bkCU3-0005YA-1a; Wed, 14 Sep 2016 18:52:23 +0300 From: Alberto Garcia To: qemu-devel@nongnu.org Date: Wed, 14 Sep 2016 18:52:19 +0300 Message-Id: <226771a1872ae391859397e45c960eaba63d2bd0.1473867967.git.berto@igalia.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 212.51.32.191 Subject: [Qemu-devel] [PATCH 6/7] commit: Add 'base' to the reopen queue before 'overlay_bs' 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 Now that we're checking for duplicates in the reopen queue, there's no need to force a specific order in which the queue is constructed so we can revert 3db2bd5508c86a1605258bc77c9672d93b5c350e. Since both ways of constructing the queue are now valid, this patch doesn't have any effect on the behavior of QEMU and is not strictly necessary. However it can help us check that the fix for the reopen queue is robust: if it stops working properly at some point, iotest 040 will break. Signed-off-by: Alberto Garcia Reviewed-by: Kevin Wolf --- block/commit.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/block/commit.c b/block/commit.c index 553e18d..3ab5e0c 100644 --- a/block/commit.c +++ b/block/commit.c @@ -243,14 +243,14 @@ void commit_start(const char *job_id, BlockDriverState *bs, orig_overlay_flags = bdrv_get_flags(overlay_bs); /* convert base & overlay_bs to r/w, if necessary */ - if (!(orig_overlay_flags & BDRV_O_RDWR)) { - reopen_queue = bdrv_reopen_queue(reopen_queue, overlay_bs, NULL, - orig_overlay_flags | BDRV_O_RDWR); - } if (!(orig_base_flags & BDRV_O_RDWR)) { reopen_queue = bdrv_reopen_queue(reopen_queue, base, NULL, orig_base_flags | BDRV_O_RDWR); } + if (!(orig_overlay_flags & BDRV_O_RDWR)) { + reopen_queue = bdrv_reopen_queue(reopen_queue, overlay_bs, NULL, + orig_overlay_flags | BDRV_O_RDWR); + } if (reopen_queue) { bdrv_reopen_multiple(reopen_queue, &local_err); if (local_err != NULL) {