Re: [Qemu-block] [Qemu-devel] [PATCH 13/16] block: only call aio_poll from iothread

2016-03-09 Thread Fam Zheng
On Wed, 03/09 10:10, Paolo Bonzini wrote: > > > On 09/03/2016 09:30, Fam Zheng wrote: > > > -aio_poll(bdrv_get_aio_context(bs), true); > > > +if (aio_context_in_iothread(ctx)) { > > > +/* This case should not occur at all, except for the > > > + * main

Re: [Qemu-block] [Qemu-devel] [PATCH 13/16] block: only call aio_poll from iothread

2016-03-09 Thread Paolo Bonzini
On 09/03/2016 09:30, Fam Zheng wrote: > > -aio_poll(bdrv_get_aio_context(bs), true); > > +if (aio_context_in_iothread(ctx)) { > > +/* This case should not occur at all, except for the > > + * main thread. > > + */ > > Maybe assert ctx ==

Re: [Qemu-block] [Qemu-devel] [PATCH 13/16] block: only call aio_poll from iothread

2016-03-09 Thread Fam Zheng
On Tue, 02/16 18:56, Paolo Bonzini wrote: > aio_poll is not thread safe; for example bdrv_drain can hang if > the last in-flight I/O operation is completed in the I/O thread after > the main thread has checked bs->in_flight. > > The bug remains latent as long as all of it is called within >