From patchwork Fri Oct 14 13:08:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alberto Garcia X-Patchwork-Id: 9376853 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 8EA6060779 for ; Fri, 14 Oct 2016 13:31:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F9742A6A8 for ; Fri, 14 Oct 2016 13:31:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 746DE2A6B7; Fri, 14 Oct 2016 13:31:38 +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.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 033FF2A6A8 for ; Fri, 14 Oct 2016 13:31:38 +0000 (UTC) Received: from localhost ([::1]:47331 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bv2aH-00084H-2A for patchwork-qemu-devel@patchwork.kernel.org; Fri, 14 Oct 2016 09:31:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49366) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bv2FV-0006oT-8r for qemu-devel@nongnu.org; Fri, 14 Oct 2016 09:10:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bv2FO-0007Du-0W for qemu-devel@nongnu.org; Fri, 14 Oct 2016 09:10:08 -0400 Received: from smtp3.mundo-r.com ([212.51.32.191]:63847 helo=smtp4.mundo-r.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bv2FN-00075H-Q2; Fri, 14 Oct 2016 09:10:01 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BDAgCE2ABY/5tjdVtcHQEFAQsBgzwBAQEBAR1XfI00lV4BAQEBAQEFAYEXAY97gjGCD4IIIIYCAoIOOBQBAgEBAQEBAQFeJ4RiAgQnUhA/EjwbGYhWAcMFATGFcoJQh2OFEwWPM4pThiiJWII8hy2GDEmQLx42RAYIgnocgVZviDUBAQE X-IPAS-Result: A2BDAgCE2ABY/5tjdVtcHQEFAQsBgzwBAQEBAR1XfI00lV4BAQEBAQEFAYEXAY97gjGCD4IIIIYCAoIOOBQBAgEBAQEBAQFeJ4RiAgQnUhA/EjwbGYhWAcMFATGFcoJQh2OFEwWPM4pThiiJWII8hy2GDEmQLx42RAYIgnocgVZviDUBAQE X-IronPort-AV: E=Sophos;i="5.31,493,1473112800"; d="scan'208";a="118727407" Received: from fanzine.igalia.com ([91.117.99.155]) by smtp4.mundo-r.com with ESMTP; 14 Oct 2016 15:08:59 +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 1bv2EM-0004Qt-28; Fri, 14 Oct 2016 15:08:58 +0200 Received: from berto by perseus.local with local (Exim 4.87) (envelope-from ) id 1bv2E1-0006kR-U9; Fri, 14 Oct 2016 16:08:37 +0300 From: Alberto Garcia To: qemu-devel@nongnu.org Date: Fri, 14 Oct 2016 16:08:20 +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 v11 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 9b5159f..a5b71b7 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -965,6 +965,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);