From patchwork Fri Oct 14 13:08:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alberto Garcia X-Patchwork-Id: 9376859 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 3726160779 for ; Fri, 14 Oct 2016 13:35:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2932D2A68E for ; Fri, 14 Oct 2016 13:35:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E05D2A6AF; Fri, 14 Oct 2016 13:35:44 +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 12A4F2A69D for ; Fri, 14 Oct 2016 13:35:43 +0000 (UTC) Received: from localhost ([::1]:47363 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bv2eE-0002nF-3d for patchwork-qemu-devel@patchwork.kernel.org; Fri, 14 Oct 2016 09:35:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49359) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bv2FV-0006oK-4L 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 1bv2FP-0007FO-L4 for qemu-devel@nongnu.org; Fri, 14 Oct 2016 09:10:07 -0400 Received: from smtp3.mundo-r.com ([212.51.32.191]:33004 helo=smtp4.mundo-r.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bv2FP-00073X-8f; Fri, 14 Oct 2016 09:10:03 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BJAgCE2ABY/5tjdVtcHgYMgzwBAQEBAR1XfKMSAQEBAQEBBQGBFwGPe4Ixgg+CCCCEV4ErAoIOOBQBAgEBAQEBAQFeJ4RiAgQnUhA/EjwbGYhWAcMFATGFcoJQh2OFEwWPM4pThiiJWII8hy2GDEmQLx42RAYIgnocgVZviDUBAQE X-IPAS-Result: A2BJAgCE2ABY/5tjdVtcHgYMgzwBAQEBAR1XfKMSAQEBAQEBBQGBFwGPe4Ixgg+CCCCEV4ErAoIOOBQBAgEBAQEBAQFeJ4RiAgQnUhA/EjwbGYhWAcMFATGFcoJQh2OFEwWPM4pThiiJWII8hy2GDEmQLx42RAYIgnocgVZviDUBAQE X-IronPort-AV: E=Sophos;i="5.31,493,1473112800"; d="scan'208";a="118727476" Received: from fanzine.igalia.com ([91.117.99.155]) by smtp4.mundo-r.com with ESMTP; 14 Oct 2016 15:09:19 +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 1bv2Eg-0004Qq-6c; Fri, 14 Oct 2016 15:09:18 +0200 Received: from berto by perseus.local with local (Exim 4.87) (envelope-from ) id 1bv2E1-0006kJ-RU; Fri, 14 Oct 2016 16:08:37 +0300 From: Alberto Garcia To: qemu-devel@nongnu.org Date: Fri, 14 Oct 2016 16:08:16 +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 04/19] block: Use block_job_add_bdrv() in mirror_start_job() 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 Use block_job_add_bdrv() instead of blocking all operations in mirror_start_job() and unblocking them in mirror_exit(). Signed-off-by: Alberto Garcia --- block/mirror.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/mirror.c b/block/mirror.c index f9d1fec..9b5159f 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -526,7 +526,6 @@ static void mirror_exit(BlockJob *job, void *opaque) aio_context_release(replace_aio_context); } g_free(s->replaces); - bdrv_op_unblock_all(target_bs, s->common.blocker); blk_unref(s->target); block_job_completed(&s->common, data->ret); g_free(data); @@ -965,7 +964,7 @@ static void mirror_start_job(const char *job_id, BlockDriverState *bs, return; } - bdrv_op_block_all(target, s->common.blocker); + block_job_add_bdrv(&s->common, target); s->common.co = qemu_coroutine_create(mirror_run, s); trace_mirror_start(bs, s, s->common.co, opaque);