From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NmX8G-0006K1-SN for qemu-devel@nongnu.org; Tue, 02 Mar 2010 13:47:48 -0500 Received: from [199.232.76.173] (port=39621 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NmX8G-0006Jg-DE for qemu-devel@nongnu.org; Tue, 02 Mar 2010 13:47:48 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NmX81-0003rh-Uk for qemu-devel@nongnu.org; Tue, 02 Mar 2010 13:47:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36192) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NmX80-0003rV-TF for qemu-devel@nongnu.org; Tue, 02 Mar 2010 13:47:33 -0500 Date: Tue, 2 Mar 2010 20:44:09 +0200 From: "Michael S. Tsirkin" Message-ID: <0b8e24d6defcdbf2f4bff4a34dfa85b63c11e5b5.1267555267.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: [Qemu-devel] [PATCHv3 11/12] tap: add API to retrieve vhost net header List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori , qemu-devel@nongnu.org Cc: amit.shah@redhat.com, kraxel@redhat.com, quintela@redhat.com will be used by virtio-net for vhost net support Signed-off-by: Michael S. Tsirkin --- net/tap.c | 7 +++++++ net/tap.h | 3 +++ 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/net/tap.c b/net/tap.c index 19c4fa2..35c05d7 100644 --- a/net/tap.c +++ b/net/tap.c @@ -487,3 +487,10 @@ int net_init_tap(QemuOpts *opts, Monitor *mon, const char *name, VLANState *vlan return 0; } + +VHostNetState *tap_get_vhost_net(VLANClientState *nc) +{ + TAPState *s = DO_UPCAST(TAPState, nc, nc); + assert(nc->info->type == NET_CLIENT_TYPE_TAP); + return s->vhost_net; +} diff --git a/net/tap.h b/net/tap.h index a244b28..b8cec83 100644 --- a/net/tap.h +++ b/net/tap.h @@ -50,4 +50,7 @@ void tap_fd_set_offload(int fd, int csum, int tso4, int tso6, int ecn, int ufo); int tap_get_fd(VLANClientState *vc); +struct vhost_net; +struct vhost_net *tap_get_vhost_net(VLANClientState *vc); + #endif /* QEMU_NET_TAP_H */ -- 1.7.0.18.g0d53a5