Re: [Qemu-devel] [RFC PATCH v5 05/14] net: port socket to GSource

2013-04-29 Thread Stefan Hajnoczi
On Sat, Apr 27, 2013 at 03:09:10PM +0800, liu ping fan wrote: > On Fri, Apr 26, 2013 at 5:48 PM, Stefan Hajnoczi wrote: > > On Fri, Apr 26, 2013 at 10:47:26AM +0800, Liu Ping Fan wrote: > >> @@ -141,6 +134,59 @@ static ssize_t > >> net_socket_receive_dgram(NetClientState *nc, const uint8_t *buf,

Re: [Qemu-devel] [RFC PATCH v5 05/14] net: port socket to GSource

2013-04-27 Thread liu ping fan
On Fri, Apr 26, 2013 at 5:48 PM, Stefan Hajnoczi wrote: > On Fri, Apr 26, 2013 at 10:47:26AM +0800, Liu Ping Fan wrote: >> @@ -141,6 +134,59 @@ static ssize_t net_socket_receive_dgram(NetClientState >> *nc, const uint8_t *buf, >> return ret; >> } >> >> +static gushort socket_connecting_read

Re: [Qemu-devel] [RFC PATCH v5 05/14] net: port socket to GSource

2013-04-26 Thread Stefan Hajnoczi
On Fri, Apr 26, 2013 at 10:47:26AM +0800, Liu Ping Fan wrote: > @@ -141,6 +134,59 @@ static ssize_t net_socket_receive_dgram(NetClientState > *nc, const uint8_t *buf, > return ret; > } > > +static gushort socket_connecting_readable(void *opaque) > +{ > +return G_IO_IN; > +} > + > +stat

[Qemu-devel] [RFC PATCH v5 05/14] net: port socket to GSource

2013-04-25 Thread Liu Ping Fan
From: Liu Ping Fan Port NetSocketState onto NetClientSource. The only thing specail is that owning to the socket's state machine changes, we need to change the handler. We implement that by destroy the old NetClientSource and attach a new one with NetSocketState. Signed-off-by: Liu Ping Fan ---