From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N10si-0006GQ-Pz for qemu-devel@nongnu.org; Thu, 22 Oct 2009 12:51:20 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N10sb-00066k-37 for qemu-devel@nongnu.org; Thu, 22 Oct 2009 12:51:17 -0400 Received: from [199.232.76.173] (port=54104 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N10sa-00066P-FK for qemu-devel@nongnu.org; Thu, 22 Oct 2009 12:51:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33328) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N10sZ-00042Q-J5 for qemu-devel@nongnu.org; Thu, 22 Oct 2009 12:51:12 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n9MGpA0o016063 for ; Thu, 22 Oct 2009 12:51:10 -0400 From: Mark McLoughlin Date: Thu, 22 Oct 2009 17:49:14 +0100 Message-Id: <1256230156-29652-14-git-send-email-markmc@redhat.com> In-Reply-To: <1256230156-29652-1-git-send-email-markmc@redhat.com> References: <1256230156-29652-1-git-send-email-markmc@redhat.com> Subject: [Qemu-devel] [PATCH 13/15] net: move tap_probe_vnet_hdr() to tap-linux.c List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Mark McLoughlin Only Linux has support for IFF_VNET_HDR Signed-off-by: Mark McLoughlin --- net/tap-aix.c | 4 ++++ net/tap-bsd.c | 5 +++++ net/tap-linux.c | 12 ++++++++++++ net/tap-solaris.c | 5 +++++ net/tap.c | 12 ------------ net/tap.h | 1 + 6 files changed, 27 insertions(+), 12 deletions(-) diff --git a/net/tap-aix.c b/net/tap-aix.c index 3f9ccdd..27143ff 100644 --- a/net/tap-aix.c +++ b/net/tap-aix.c @@ -36,3 +36,7 @@ int tap_set_sndbuf(int fd, QemuOpts *opts) return 0; } +int tap_probe_vnet_hdr(int fd) +{ + return 0; +} diff --git a/net/tap-bsd.c b/net/tap-bsd.c index e28615f..1cdde90 100644 --- a/net/tap-bsd.c +++ b/net/tap-bsd.c @@ -65,3 +65,8 @@ int tap_set_sndbuf(int fd, QemuOpts *opts) { return 0; } + +int tap_probe_vnet_hdr(int fd) +{ + return 0; +} diff --git a/net/tap-linux.c b/net/tap-linux.c index 6c3b6e3..0059404 100644 --- a/net/tap-linux.c +++ b/net/tap-linux.c @@ -99,3 +99,15 @@ int tap_set_sndbuf(int fd, QemuOpts *opts) } return 0; } + +int tap_probe_vnet_hdr(int fd) +{ + struct ifreq ifr; + + if (ioctl(fd, TUNGETIFF, &ifr) != 0) { + qemu_error("TUNGETIFF ioctl() failed: %s\n", strerror(errno)); + return 0; + } + + return ifr.ifr_flags & IFF_VNET_HDR; +} diff --git a/net/tap-solaris.c b/net/tap-solaris.c index de5855a..3f48e57 100644 --- a/net/tap-solaris.c +++ b/net/tap-solaris.c @@ -188,3 +188,8 @@ int tap_set_sndbuf(int fd, QemuOpts *opts) { return 0; } + +int tap_probe_vnet_hdr(int fd) +{ + return 0; +} diff --git a/net/tap.c b/net/tap.c index df2cfbe..3f6722e 100644 --- a/net/tap.c +++ b/net/tap.c @@ -239,18 +239,6 @@ void tap_using_vnet_hdr(VLANClientState *vc, int using_vnet_hdr) s->using_vnet_hdr = using_vnet_hdr; } -static int tap_probe_vnet_hdr(int fd) -{ - struct ifreq ifr; - - if (ioctl(fd, TUNGETIFF, &ifr) != 0) { - qemu_error("TUNGETIFF ioctl() failed: %s\n", strerror(errno)); - return 0; - } - - return ifr.ifr_flags & IFF_VNET_HDR; -} - void tap_set_offload(VLANClientState *vc, int csum, int tso4, int tso6, int ecn, int ufo) { diff --git a/net/tap.h b/net/tap.h index 0d67c24..de729a7 100644 --- a/net/tap.h +++ b/net/tap.h @@ -44,5 +44,6 @@ void tap_using_vnet_hdr(VLANClientState *vc, int using_vnet_hdr); void tap_set_offload(VLANClientState *vc, int csum, int tso4, int tso6, int ecn, int ufo); int tap_set_sndbuf(int fd, QemuOpts *opts); +int tap_probe_vnet_hdr(int fd); #endif /* QEMU_NET_TAP_H */ -- 1.6.2.5