From patchwork Wed Oct 26 10:29:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alberto Garcia X-Patchwork-Id: 9396541 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 2D1A9600BA for ; Wed, 26 Oct 2016 10:35:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA2BC28974 for ; Wed, 26 Oct 2016 10:35:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CE952291CD; Wed, 26 Oct 2016 10:35:57 +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 8396628974 for ; Wed, 26 Oct 2016 10:35:57 +0000 (UTC) Received: from localhost ([::1]:33026 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bzLYq-0007dL-NV for patchwork-qemu-devel@patchwork.kernel.org; Wed, 26 Oct 2016 06:35:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47922) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bzLTW-0003gO-4I for qemu-devel@nongnu.org; Wed, 26 Oct 2016 06:30:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bzLTT-0001oZ-D6 for qemu-devel@nongnu.org; Wed, 26 Oct 2016 06:30:26 -0400 Received: from smtp3.mundo-r.com ([212.51.32.191]:61936 helo=smtp4.mundo-r.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bzLTT-0001nv-6t; Wed, 26 Oct 2016 06:30:23 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CUAwB1hRBY/5tjdVtcHQEFAQsBgyoBAQEBAR1YcguNNZVXAQEBAQEBBQGBF5ABgjOCD4IJH4YDAoIAPxQBAgEBAQEBAQFiKEIOAYQSAgQnUhA/EjwbGYhYAcBAATCFcoJQh2OFEwWPPopYhiyJdII8hzaGEkmQQh42UAYIgxkcgVVvhBSEUgEBAQ X-IPAS-Result: A2CUAwB1hRBY/5tjdVtcHQEFAQsBgyoBAQEBAR1YcguNNZVXAQEBAQEBBQGBF5ABgjOCD4IJH4YDAoIAPxQBAgEBAQEBAQFiKEIOAYQSAgQnUhA/EjwbGYhYAcBAATCFcoJQh2OFEwWPPopYhiyJdII8hzaGEkmQQh42UAYIgxkcgVVvhBSEUgEBAQ X-IronPort-AV: E=Sophos;i="5.31,550,1473112800"; d="scan'208";a="202588322" Received: from fanzine.igalia.com ([91.117.99.155]) by smtp4.mundo-r.com with ESMTP; 26 Oct 2016 12:30:05 +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 1bzLT9-00026W-VC; Wed, 26 Oct 2016 12:30:04 +0200 Received: from berto by perseus.local with local (Exim 4.87) (envelope-from ) id 1bzLSr-0001Zj-Qx; Wed, 26 Oct 2016 13:29:45 +0300 From: Alberto Garcia To: qemu-devel@nongnu.org Date: Wed, 26 Oct 2016 13:29:22 +0300 Message-Id: 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 v12 08/19] block: Block all intermediate nodes in commit_active_start() 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, Markus Armbruster , Max Reitz Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP When block-commit is launched without the top parameter, it uses internally a mirror block job. In that case all intermediate nodes between the active and base nodes must be blocked as well. Signed-off-by: Alberto Garcia Reviewed-by: Kevin Wolf --- block/mirror.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/block/mirror.c b/block/mirror.c index a4273f6..94be565 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -967,6 +967,14 @@ static void mirror_start_job(const char *job_id, BlockDriverState *bs, } block_job_add_bdrv(&s->common, target); + /* In commit_active_start() all intermediate nodes disappear, so + * any jobs in them must be blocked */ + if (bdrv_chain_contains(bs, target)) { + BlockDriverState *iter; + for (iter = backing_bs(bs); iter != target; iter = backing_bs(iter)) { + block_job_add_bdrv(&s->common, iter); + } + } s->common.co = qemu_coroutine_create(mirror_run, s); trace_mirror_start(bs, s, s->common.co, opaque);