From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USNuH-00084o-1X for qemu-devel@nongnu.org; Wed, 17 Apr 2013 04:39:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1USNuF-0002uf-IP for qemu-devel@nongnu.org; Wed, 17 Apr 2013 04:39:56 -0400 Received: from mail-gh0-f180.google.com ([209.85.160.180]:33268) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USNuF-0002uV-Eb for qemu-devel@nongnu.org; Wed, 17 Apr 2013 04:39:55 -0400 Received: by mail-gh0-f180.google.com with SMTP id f13so120707ghb.39 for ; Wed, 17 Apr 2013 01:39:55 -0700 (PDT) From: Liu Ping Fan Date: Wed, 17 Apr 2013 16:39:11 +0800 Message-Id: <1366187964-14265-3-git-send-email-qemulist@gmail.com> In-Reply-To: <1366187964-14265-1-git-send-email-qemulist@gmail.com> References: <1366187964-14265-1-git-send-email-qemulist@gmail.com> Subject: [Qemu-devel] [RFC PATCH v4 02/15] net: introduce bind_ctx to NetClientInfo List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mdroth , Paolo Bonzini , Stefan Hajnoczi , Anthony Liguori , Jan Kiszka From: Liu Ping Fan Introduce bind_ctx interface for NetClientState. It will help to bind NetClientState with a GSource. Currently, these GSource attached with default context, but in future, after resolving all the race condition in network layer, NetClientStates can run on different threads Signed-off-by: Liu Ping Fan --- include/net/net.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/include/net/net.h b/include/net/net.h index cb049a1..88332d2 100644 --- a/include/net/net.h +++ b/include/net/net.h @@ -44,6 +44,7 @@ typedef ssize_t (NetReceiveIOV)(NetClientState *, const struct iovec *, int); typedef void (NetCleanup) (NetClientState *); typedef void (LinkStatusChanged)(NetClientState *); typedef void (NetClientDestructor)(NetClientState *); +typedef void (NetClientBindCtx)(NetClientState *, GMainContext *); typedef struct NetClientInfo { NetClientOptionsKind type; @@ -55,6 +56,7 @@ typedef struct NetClientInfo { NetCleanup *cleanup; LinkStatusChanged *link_status_changed; NetPoll *poll; + NetClientBindCtx *bind_ctx; } NetClientInfo; struct NetClientState { -- 1.7.4.4