From patchwork Thu Feb 4 15:28:48 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: 77044 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o14FW3j2018848 for ; Thu, 4 Feb 2010 15:32:03 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932565Ab0BDPcA (ORCPT ); Thu, 4 Feb 2010 10:32:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:20396 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932229Ab0BDPcA (ORCPT ); Thu, 4 Feb 2010 10:32:00 -0500 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o14FVxub005646 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 4 Feb 2010 10:31:59 -0500 Received: from redhat.com (vpn2-9-138.ams2.redhat.com [10.36.9.138]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id o14FVvcH005841 for ; Thu, 4 Feb 2010 10:31:58 -0500 Date: Thu, 4 Feb 2010 17:28:48 +0200 From: "Michael S. Tsirkin" To: kvm@vger.kernel.org Subject: [PATCH 15/20] tap: add API to retrieve vhost net header Message-ID: <20100204152848.GP8461@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 04 Feb 2010 15:32:04 +0000 (UTC) diff --git a/net/tap.c b/net/tap.c index d9f2e41..166cf05 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 */