Re: [Qemu-devel] [RFC PATCH v4 06/15] net: port socket to GSource

2013-04-22 Thread liu ping fan
On Fri, Apr 19, 2013 at 8:03 PM, Stefan Hajnoczi stefa...@redhat.com wrote: On Fri, Apr 19, 2013 at 01:58:40PM +0800, liu ping fan wrote: On Thu, Apr 18, 2013 at 10:34 PM, Stefan Hajnoczi stefa...@gmail.com wrote: On Wed, Apr 17, 2013 at 04:39:15PM +0800, Liu Ping Fan wrote: I'm a little

Re: [Qemu-devel] [RFC PATCH v4 06/15] net: port socket to GSource

2013-04-19 Thread Stefan Hajnoczi
On Fri, Apr 19, 2013 at 01:58:40PM +0800, liu ping fan wrote: On Thu, Apr 18, 2013 at 10:34 PM, Stefan Hajnoczi stefa...@gmail.com wrote: On Wed, Apr 17, 2013 at 04:39:15PM +0800, Liu Ping Fan wrote: I'm a little worried that we're lacking G_IO_HUP | G_IO_ERR. Perhaps disconnect and

Re: [Qemu-devel] [RFC PATCH v4 06/15] net: port socket to GSource

2013-04-18 Thread Stefan Hajnoczi
On Wed, Apr 17, 2013 at 04:39:15PM +0800, Liu Ping Fan wrote: @@ -160,7 +154,13 @@ static void net_socket_send(void *opaque) net_socket_read_poll(s, false); net_socket_write_poll(s, false); if (s-listen_fd != -1) { -qemu_set_fd_handler(s-listen_fd,

Re: [Qemu-devel] [RFC PATCH v4 06/15] net: port socket to GSource

2013-04-18 Thread liu ping fan
On Thu, Apr 18, 2013 at 10:34 PM, Stefan Hajnoczi stefa...@gmail.com wrote: On Wed, Apr 17, 2013 at 04:39:15PM +0800, Liu Ping Fan wrote: @@ -160,7 +154,13 @@ static void net_socket_send(void *opaque) net_socket_read_poll(s, false); net_socket_write_poll(s, false);

[Qemu-devel] [RFC PATCH v4 06/15] net: port socket to GSource

2013-04-17 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com 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.