Stefan Hajnoczi <stefa...@redhat.com> writes: > On Mon, Jun 29, 2015 at 08:10:20AM +0200, Markus Armbruster wrote: >> Alexander Yarygin <yary...@linux.vnet.ibm.com> writes: >> > Markus Armbruster <arm...@redhat.com> writes: >> > * Ignorant answer: I was told that the bdrv_drain_all()'s comment is >> > obsolete and we can use bdrv_drain(). Here is a link to the old >> > thread: http://marc.info/?l=qemu-devel&m=143154211017926&w=2. >> >> Kevin, Stefan, if the comment has become wrong, it needs to be redone. >> Who's going to take care of it? > > I couldn't think of a scenario where this patch is unsafe. > > The danger is that the I/O code path depends on something outside the > AioContext. In that case you block in aio_poll(aio_context, true) > forever without making progress. The thing the I/O request depends on > will never finish. > > Code that accesses multiple BDSes puts them into the same AioContext, so > this should not be a problem in practice.
Stefan, could you rework the bdrv_drain()'s to spell out how it can be used safely?