On Thu, Jul 3, 2014 at 6:04 PM, Paolo Bonzini <pbonz...@redhat.com> wrote: > Il 03/07/2014 11:51, Ming Lei ha scritto: > >>>> >> +int laio_io_unplug(BlockDriverState *bs, void *aio_ctx, bool unplug) >>>> >> +{ >>>> >> + struct qemu_laio_state *s = aio_ctx; >>>> >> + int ret = 0; >>>> >> + >>> >>> > >>> > How about an assert(s->io_q.plugged > 0); here? >> >> how about just adding a warning because flush io queue uses >> the function too? > > > This suggest that there is a smaller piece of code that both laio_io_unplug > ad flush io queue should use. However, not that flush io queue is not > necessary. The only place where you're using it (before a call to > bdrv_aio_flush) does not need it.
I think it may be needed: - following requests coming inside handle_notify(): req0, req1, req2-flush, req3 - both req0 and req1 queued - start to handle req2-flush - bdrv_co_flush() calls bdrv_co_flush(bs->file), which finally call raw_aio_flush() to send command, but the 1st two requests should have been submitted to fs before the flush action Thanks,