qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 4/5] mirror: follow AioContext change gracefu


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v4 4/5] mirror: follow AioContext change gracefully
Date: Thu, 16 Jun 2016 11:17:24 +0100
User-agent: Mutt/1.6.1 (2016-04-27)

On Wed, Jun 15, 2016 at 10:57:49AM +0200, Paolo Bonzini wrote:
> On 14/06/2016 20:17, Stefan Hajnoczi wrote:
> > +/* There is no matching mirror_resume() because mirror_run() will begin
> > + * iterating again when the job is resumed.
> > + */
> > +static void mirror_pause(BlockJob *job)
> > +{
> > +    MirrorBlockJob *s = container_of(job, MirrorBlockJob, common);
> > +
> > +    while (s->in_flight > 0) {
> > +        aio_poll(blk_get_aio_context(job->blk), true);
> > +    }
> 
> This is calling aio_poll from a coroutine, which is ugly -- see Fam's
> recent introduction of bdrv_co_drain.  I think this should call
> mirror_drain instead.

This is not called from coroutine context, so I couldn't use
mirror_drain().

BlockJobDriver->pause() and attached_aio_context() are both not
coroutine_fn.  That's because bdrv_attach_aio_context() is not
coroutine_fn and can be called from a monitor command or device
emulation code.

Stefan

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]