From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuxYF-0007tX-CW for qemu-devel@nongnu.org; Wed, 20 May 2015 02:32:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YuxYE-0007ru-GN for qemu-devel@nongnu.org; Wed, 20 May 2015 02:32:23 -0400 Sender: Paolo Bonzini Message-ID: <555C2A6E.8020009@redhat.com> Date: Wed, 20 May 2015 08:32:14 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1432102576-6637-1-git-send-email-famz@redhat.com> <1432102576-6637-14-git-send-email-famz@redhat.com> In-Reply-To: <1432102576-6637-14-git-send-email-famz@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v5 13/13] block/mirror: Block "device IO" during mirror exit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Cc: Kevin Wolf , qemu-block@nongnu.org, jcody@redhat.com, armbru@redhat.com, mreitz@redhat.com, Stefan Hajnoczi , amit.shah@redhat.com On 20/05/2015 08:16, Fam Zheng wrote: > > static void mirror_exit(BlockJob *job, void *opaque) > @@ -328,6 +330,8 @@ static void mirror_exit(BlockJob *job, void *opaque) > MirrorExitData *data = opaque; > AioContext *replace_aio_context = NULL; > > + bdrv_op_unblock(s->common.bs, BLOCK_OP_TYPE_DEVICE_IO, data->blocker); > + error_free(data->blocker); > if (s->to_replace) { > replace_aio_context = bdrv_get_aio_context(s->to_replace); > aio_context_acquire(replace_aio_context); Why here and not after the "if (s->should_complete && data->ret == 0) { ... }"? The commit message says "unblock it after bdrv_swap()." This is the only remaining issue. Paolo