[Qemu-devel] [RFC] Convert AioContext to Gsource sub classes

2013-08-09 Thread Wenchao Xia
Hi folks, I'd like form a series which remove AioContext's concept and bind to glib's main loop more closely. Since changed place will be a bit much so want to know your opinion before real coding: changes: **before patch: typedef struct AioContext { GSource source; int walking_handlers;

Re: [Qemu-devel] [RFC] Convert AioContext to Gsource sub classes

2013-08-10 Thread Paolo Bonzini
Il 10/08/2013 05:24, Wenchao Xia ha scritto: > Hi folks, > I'd like form a series which remove AioContext's concept and > bind to glib's main loop more closely. Since changed place will be > a bit much so want to know your opinion before real coding: I'm not sure I understand... What does it bu

Re: [Qemu-devel] [RFC] Convert AioContext to Gsource sub classes

2013-08-10 Thread Alex Bligh
--On 10 August 2013 11:24:01 +0800 Wenchao Xia wrote: I'd like form a series which remove AioContext's concept and bind to glib's main loop more closely. Since changed place will be a bit much so want to know your opinion before real coding: This may well clash with the aio / timers pat

Re: [Qemu-devel] [RFC] Convert AioContext to Gsource sub classes

2013-08-11 Thread Wenchao Xia
> Il 10/08/2013 05:24, Wenchao Xia ha scritto: >> Hi folks, >>I'd like form a series which remove AioContext's concept and >> bind to glib's main loop more closely. Since changed place will be >> a bit much so want to know your opinion before real coding: > > I'm not sure I understand... What

Re: [Qemu-devel] [RFC] Convert AioContext to Gsource sub classes

2013-08-12 Thread Paolo Bonzini
> 1) rename AioContext to AioSource. > This is my major purpose, which declare it is not a "context" concept, > and GMainContext is the entity represent the thread's activity. Note that the nested event loops in QEMU are _very_ different from glib nested event loops. In QEMU, nested event loop

Re: [Qemu-devel] [RFC] Convert AioContext to Gsource sub classes

2013-08-12 Thread Michael Roth
Quoting Paolo Bonzini (2013-08-12 02:30:28) > > 1) rename AioContext to AioSource. > > This is my major purpose, which declare it is not a "context" concept, > > and GMainContext is the entity represent the thread's activity. > > Note that the nested event loops in QEMU are _very_ different from

Re: [Qemu-devel] [RFC] Convert AioContext to Gsource sub classes

2013-08-13 Thread Wenchao Xia
于 2013-8-13 1:01, Michael Roth 写道: Quoting Paolo Bonzini (2013-08-12 02:30:28) 1) rename AioContext to AioSource. This is my major purpose, which declare it is not a "context" concept, and GMainContext is the entity represent the thread's activity. Note that the nested event loops in QEMU a

Re: [Qemu-devel] [RFC] Convert AioContext to Gsource sub classes

2013-08-15 Thread Michael Roth
Quoting Wenchao Xia (2013-08-13 03:44:39) > 于 2013-8-13 1:01, Michael Roth 写道: > > Quoting Paolo Bonzini (2013-08-12 02:30:28) > >>> 1) rename AioContext to AioSource. > >>>This is my major purpose, which declare it is not a "context" concept, > >>> and GMainContext is the entity represent the

Re: [Qemu-devel] [RFC] Convert AioContext to Gsource sub classes

2013-08-15 Thread Michael Roth
Quoting Michael Roth (2013-08-15 10:23:20) > Quoting Wenchao Xia (2013-08-13 03:44:39) > > 于 2013-8-13 1:01, Michael Roth 写道: > > > Quoting Paolo Bonzini (2013-08-12 02:30:28) > > >>> 1) rename AioContext to AioSource. > > >>>This is my major purpose, which declare it is not a "context" > > >>

Re: [Qemu-devel] [RFC] Convert AioContext to Gsource sub classes

2013-08-16 Thread Wenchao Xia
于 2013-8-16 0:32, Michael Roth 写道: Quoting Michael Roth (2013-08-15 10:23:20) Quoting Wenchao Xia (2013-08-13 03:44:39) 于 2013-8-13 1:01, Michael Roth 写道: Quoting Paolo Bonzini (2013-08-12 02:30:28) 1) rename AioContext to AioSource. This is my major purpose, which declare it is not a "co

Re: [Qemu-devel] [RFC] Convert AioContext to Gsource sub classes

2013-08-16 Thread Wenchao Xia
于 2013-8-16 15:15, Wenchao Xia 写道: 于 2013-8-16 0:32, Michael Roth 写道: Quoting Michael Roth (2013-08-15 10:23:20) Quoting Wenchao Xia (2013-08-13 03:44:39) 于 2013-8-13 1:01, Michael Roth 写道: Quoting Paolo Bonzini (2013-08-12 02:30:28) 1) rename AioContext to AioSource. This is my major pu

Re: [Qemu-devel] [RFC] Convert AioContext to Gsource sub classes

2013-08-20 Thread Wenchao Xia
于 2013-8-16 16:12, Wenchao Xia 写道: 于 2013-8-16 15:15, Wenchao Xia 写道: 于 2013-8-16 0:32, Michael Roth 写道: Quoting Michael Roth (2013-08-15 10:23:20) Quoting Wenchao Xia (2013-08-13 03:44:39) 于 2013-8-13 1:01, Michael Roth 写道: Quoting Paolo Bonzini (2013-08-12 02:30:28) 1) rename AioContext t

Re: [Qemu-devel] [RFC] Convert AioContext to Gsource sub classes

2013-08-20 Thread Alex Bligh
On 20 Aug 2013, at 10:59, Wenchao Xia wrote: > The main issue here is that components are tightly bind together and > no clear layer represent the thread and event loop API. Block and hw > code are inter acting with AioContext, so both GMainContext and > AioContext are playing the role. I hope t

Re: [Qemu-devel] [RFC] Convert AioContext to Gsource sub classes

2013-08-21 Thread Stefan Hajnoczi
On Tue, Aug 20, 2013 at 05:59:58PM +0800, Wenchao Xia wrote: > 于 2013-8-16 16:12, Wenchao Xia 写道: > >于 2013-8-16 15:15, Wenchao Xia 写道: > >>于 2013-8-16 0:32, Michael Roth 写道: > >>>Quoting Michael Roth (2013-08-15 10:23:20) > Quoting Wenchao Xia (2013-08-13 03:44:39) > >于 2013-8-13 1:01, Mic

Re: [Qemu-devel] [RFC] Convert AioContext to Gsource sub classes

2013-08-21 Thread Wenchao Xia
于 2013-8-21 16:45, Stefan Hajnoczi 写道: On Tue, Aug 20, 2013 at 05:59:58PM +0800, Wenchao Xia wrote: 于 2013-8-16 16:12, Wenchao Xia 写道: 于 2013-8-16 15:15, Wenchao Xia 写道: 于 2013-8-16 0:32, Michael Roth 写道: Quoting Michael Roth (2013-08-15 10:23:20) Quoting Wenchao Xia (2013-08-13 03:44:39) 于

Re: [Qemu-devel] [RFC] Convert AioContext to Gsource sub classes

2013-08-21 Thread Alex Bligh
--On 21 August 2013 10:45:53 +0200 Stefan Hajnoczi wrote: Since AioContext provides a GSource, integrating with an application's glib event loop should also be easy. The only hard part is timers, since we use nanosecond timers - there we should just round up to millisecond granularity to l

Re: [Qemu-devel] [RFC] Convert AioContext to Gsource sub classes

2013-08-22 Thread Stefan Hajnoczi
On Wed, Aug 21, 2013 at 05:33:41PM +0800, Wenchao Xia wrote: > 于 2013-8-21 16:45, Stefan Hajnoczi 写道: > >On Tue, Aug 20, 2013 at 05:59:58PM +0800, Wenchao Xia wrote: > >>于 2013-8-16 16:12, Wenchao Xia 写道: > >>>于 2013-8-16 15:15, Wenchao Xia 写道: > 于 2013-8-16 0:32, Michael Roth 写道: > >Quotin