qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v6 1/3] linux-aio: fix submit aio as a batch


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v6 1/3] linux-aio: fix submit aio as a batch
Date: Tue, 25 Nov 2014 13:08:04 +0000
User-agent: Mutt/1.5.23 (2014-03-12)

On Tue, Nov 25, 2014 at 03:23:11PM +0800, Ming Lei wrote:
> @@ -296,12 +370,14 @@ void laio_detach_aio_context(void *s_, AioContext 
> *old_context)
>  
>      aio_set_event_notifier(old_context, &s->e, NULL);
>      qemu_bh_delete(s->completion_bh);
> +    qemu_bh_delete(s->io_q.abort_bh);
>  }
>  
>  void laio_attach_aio_context(void *s_, AioContext *new_context)
>  {
>      struct qemu_laio_state *s = s_;
>  
> +    s->io_q.abort_bh = aio_bh_new(new_context, ioq_abort_bh, s);
>      s->completion_bh = aio_bh_new(new_context, qemu_laio_completion_bh, s);
>      aio_set_event_notifier(new_context, &s->e, qemu_laio_completion_cb);
>  }

These functions are incomplete when ->aborting == true.  I can't think
of a reason why we are guaranteed never to hit that state, and fixing it
is easy.  Just add the following to the end of
laio_attach_aio_context():

if (s->aborting) {
    qemu_bh_schedule(s->io_q.abort_bh);
}

Stefan

Attachment: pgpYIGsfV4w0w.pgp
Description: PGP signature


reply via email to

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