From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34126) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRdGZ-0005tH-1e for qemu-devel@nongnu.org; Wed, 20 Dec 2017 07:14:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRdGY-0006Jw-97 for qemu-devel@nongnu.org; Wed, 20 Dec 2017 07:14:30 -0500 Date: Wed, 20 Dec 2017 20:14:21 +0800 From: Fam Zheng Message-ID: <20171220121421.GC10812@lemon> References: <20171220103412.13048-1-kwolf@redhat.com> <20171220103412.13048-3-kwolf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171220103412.13048-3-kwolf@redhat.com> Subject: Re: [Qemu-devel] [PATCH 02/19] block: Assert drain_all is only called from main AioContext List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-block@nongnu.org, pbonzini@redhat.com, qemu-devel@nongnu.org On Wed, 12/20 11:33, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf > --- > block/io.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/block/io.c b/block/io.c > index cf780c3cb0..b94740b8ff 100644 > --- a/block/io.c > +++ b/block/io.c > @@ -330,6 +330,12 @@ void bdrv_drain_all_begin(void) > BdrvNextIterator it; > GSList *aio_ctxs = NULL, *ctx; > > + /* BDRV_POLL_WHILE() for a node can only be called from its own I/O thread > + * or the main loop AioContext. We potentially use BDRV_POLL_WHILE() on > + * nodes in several different AioContexts, so make sure we're in the main > + * context. */ > + assert(qemu_get_current_aio_context() == qemu_get_aio_context()); > + > block_job_pause_all(); > > for (bs = bdrv_first(&it); bs; bs = bdrv_next(&it)) { > -- > 2.13.6 > Reviewed-by: Fam Zheng