Re: [Qemu-devel] [PATCH 09/17] aio: prepare for introducing GSource-based dispatch

2012-09-30 Thread Paolo Bonzini
Il 29/09/2012 13:28, Blue Swirl ha scritto: >> > +if (node->pfd.fd == fd) > Forgot to run checkpatch.pl? > No, just ignored its result for an RFC. Paolo

Re: [Qemu-devel] [PATCH 09/17] aio: prepare for introducing GSource-based dispatch

2012-09-29 Thread Blue Swirl
On Tue, Sep 25, 2012 at 12:55 PM, Paolo Bonzini wrote: > This adds a GPollFD to each AioHandler. It will then be possible to > attach these GPollFDs to a GSource, and from there to the main loop. > aio_wait examines the GPollFDs and avoids calling select() if any > is set (similar to what it does

Re: [Qemu-devel] [PATCH 09/17] aio: prepare for introducing GSource-based dispatch

2012-09-25 Thread Paolo Bonzini
Il 26/09/2012 00:01, Anthony Liguori ha scritto: > > +revents = node->pfd.revents & node->pfd.events; > > +node->pfd.revents &= ~revents; > > This is interesting and I must admit I don't understand why it's > necessary. What case are you trying to handle? That's for the case wher

Re: [Qemu-devel] [PATCH 09/17] aio: prepare for introducing GSource-based dispatch

2012-09-25 Thread Paolo Bonzini
Il 26/09/2012 00:01, Anthony Liguori ha scritto: >> > +node->pfd.events = G_IO_ERR; >> > +node->pfd.events |= (io_read ? G_IO_IN | G_IO_HUP : 0); >> > +node->pfd.events |= (io_write ? G_IO_OUT : 0); >> > } > Should we even set G_IO_ERR? I think that corresponds to exce

Re: [Qemu-devel] [PATCH 09/17] aio: prepare for introducing GSource-based dispatch

2012-09-25 Thread Anthony Liguori
Paolo Bonzini writes: > This adds a GPollFD to each AioHandler. It will then be possible to > attach these GPollFDs to a GSource, and from there to the main loop. > aio_wait examines the GPollFDs and avoids calling select() if any > is set (similar to what it does if bottom halves are available)

[Qemu-devel] [PATCH 09/17] aio: prepare for introducing GSource-based dispatch

2012-09-25 Thread Paolo Bonzini
This adds a GPollFD to each AioHandler. It will then be possible to attach these GPollFDs to a GSource, and from there to the main loop. aio_wait examines the GPollFDs and avoids calling select() if any is set (similar to what it does if bottom halves are available). Signed-off-by: Paolo Bonzini