From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45688) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULE7S-0004RR-M0 for qemu-devel@nongnu.org; Thu, 28 Mar 2013 10:48:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ULE7M-0004YN-MW for qemu-devel@nongnu.org; Thu, 28 Mar 2013 10:47:58 -0400 Received: from mail-wi0-x22c.google.com ([2a00:1450:400c:c05::22c]:45132) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULE7M-0004Y9-Gd for qemu-devel@nongnu.org; Thu, 28 Mar 2013 10:47:52 -0400 Received: by mail-wi0-f172.google.com with SMTP id hr17so3385802wib.5 for ; Thu, 28 Mar 2013 07:47:51 -0700 (PDT) Date: Thu, 28 Mar 2013 15:47:48 +0100 From: Stefan Hajnoczi Message-ID: <20130328144748.GJ22865@stefanha-thinkpad.redhat.com> References: <1364457355-4119-1-git-send-email-qemulist@gmail.com> <1364457355-4119-4-git-send-email-qemulist@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1364457355-4119-4-git-send-email-qemulist@gmail.com> Subject: Re: [Qemu-devel] [RFC PATCH v2 3/4] net: port hub onto glib List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Liu Ping Fan Cc: Paolo Bonzini , Anthony Liguori , qemu-devel@nongnu.org, mdroth On Thu, Mar 28, 2013 at 03:55:54PM +0800, Liu Ping Fan wrote: > From: Liu Ping Fan > > Attach each hubport with a GSource. Currently the GSource is attached > to default main context, and the hub still run on iothread, but in > future, after making the whole layer thread-safe, we will admit ports > to run on different thread. > > Signed-off-by: Liu Ping Fan > --- > hw/qdev-properties-system.c | 1 + > include/net/queue.h | 14 ++++++++++++++ > net/hub.c | 34 ++++++++++++++++++++++++++++++++-- > net/net.c | 1 + > net/queue.c | 4 ++-- > 5 files changed, 50 insertions(+), 4 deletions(-) There are two possibilities when a hub is used: 1. All net clients on the hub run in the same event loop. We don't need any code changes to make this work. 2. Net clients run in different event loops. I don't think this case matters, let's forbid it. It's not worth adding more complexity to the net subsystem in order to support it. Can you think of a use case that is well-served by net clients in multiple event loops? Stefan