[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] block: fix streaming/closing race
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH] block: fix streaming/closing race |
Date: |
Fri, 30 Mar 2012 11:25:24 +0100 |
On Fri, Mar 30, 2012 at 9:31 AM, Paolo Bonzini <address@hidden> 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