From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41254) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yuxih-0002l1-2g for qemu-devel@nongnu.org; Wed, 20 May 2015 02:43:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yuxig-0002Mt-AP for qemu-devel@nongnu.org; Wed, 20 May 2015 02:43:11 -0400 Date: Wed, 20 May 2015 14:43:01 +0800 From: Fam Zheng Message-ID: <20150520064301.GF6219@ad.nay.redhat.com> References: <1432102576-6637-1-git-send-email-famz@redhat.com> <1432102576-6637-14-git-send-email-famz@redhat.com> <555C2A6E.8020009@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <555C2A6E.8020009@redhat.com> 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: Paolo Bonzini Cc: Kevin Wolf , qemu-block@nongnu.org, armbru@redhat.com, jcody@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com, Stefan Hajnoczi , amit.shah@redhat.com On Wed, 05/20 08:32, Paolo Bonzini wrote: > > > 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. Ouch, I thought I did that... It absolutely has to go after bdrv_swap(). Fam