From patchwork Thu Feb 25 18:28:28 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 46272 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3FFD3B7C98 for ; Fri, 26 Feb 2010 06:14:12 +1100 (EST) Received: from localhost ([127.0.0.1]:56989 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nkijy-0005Nv-1B for incoming@patchwork.ozlabs.org; Thu, 25 Feb 2010 13:47:14 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NkiUz-0001QO-SI for qemu-devel@nongnu.org; Thu, 25 Feb 2010 13:31:45 -0500 Received: from [199.232.76.173] (port=56229 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NkiUz-0001QA-DM for qemu-devel@nongnu.org; Thu, 25 Feb 2010 13:31:45 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NkiUy-0006hf-E4 for qemu-devel@nongnu.org; Thu, 25 Feb 2010 13:31:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42391) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NkiUx-0006hV-WE for qemu-devel@nongnu.org; Thu, 25 Feb 2010 13:31:44 -0500 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o1PIVfsZ030316 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 25 Feb 2010 13:31:41 -0500 Received: from redhat.com (vpn2-11-182.ams2.redhat.com [10.36.11.182]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id o1PIVccn028764; Thu, 25 Feb 2010 13:31:39 -0500 Date: Thu, 25 Feb 2010 20:28:28 +0200 From: "Michael S. Tsirkin" To: Anthony Liguori , qemu-devel@nongnu.org Message-ID: <1ee20179661f1da6b0cc5bdcd74955bd5b28aead.1267122331.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mutt-Fcc: =sent User-Agent: Mutt/1.5.19 (2009-01-05) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: amit.shah@redhat.com, kraxel@redhat.com, quintela@redhat.com Subject: [Qemu-devel] [PATCHv2 11/12] tap: add API to retrieve vhost net header X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 65797ef..9bb11fc 100644 --- a/net/tap.c +++ b/net/tap.c @@ -491,3 +491,10 @@ int net_init_tap(QemuOpts *opts, Monitor *mon, const char *name, VLANState *vlan return 0; } + +struct vhost_net *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 */