On Fri, Mar 30, 2012 at 9:31 AM, Paolo Bonzini <pbonz...@redhat.com> wrote: > Il 30/03/2012 09:19, Stefan Hajnoczi ha scritto: >>> > +void block_job_cancel_sync(BlockJob *job) >>> > +{ >>> > + BlockDriverState *bs = job->bs; >>> > + >>> > + assert(bs->job == job); >>> > + block_job_cancel(job); >>> > + while (bs->job != NULL && bs->job->busy) { >> It's not clear to me why we have a busy flag. > > Because the coroutine does not restart if you do qemu_aio_wait and the > coroutine is waiting in co_sleep. So the busy flag communicates that > the coroutine is quiescent and, when cancelled, will not issue any new I/O.
Ah, yes. This is tricky, a comment would be nice. Stefan