OSDN Git Service

net: move tap_probe_vnet_hdr() to tap-linux.c
authorMark McLoughlin <markmc@redhat.com>
Thu, 22 Oct 2009 16:49:14 +0000 (17:49 +0100)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 30 Oct 2009 13:39:28 +0000 (08:39 -0500)
Only Linux has support for IFF_VNET_HDR

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
net/tap-aix.c
net/tap-bsd.c
net/tap-linux.c
net/tap-solaris.c
net/tap.c
net/tap.h

index 3f9ccdd..27143ff 100644 (file)
@@ -36,3 +36,7 @@ int tap_set_sndbuf(int fd, QemuOpts *opts)
     return 0;
 }
 
+int tap_probe_vnet_hdr(int fd)
+{
+    return 0;
+}
index e28615f..1cdde90 100644 (file)
@@ -65,3 +65,8 @@ int tap_set_sndbuf(int fd, QemuOpts *opts)
 {
     return 0;
 }
+
+int tap_probe_vnet_hdr(int fd)
+{
+    return 0;
+}
index 6c3b6e3..0059404 100644 (file)
@@ -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;
+}
index de5855a..3f48e57 100644 (file)
@@ -188,3 +188,8 @@ int tap_set_sndbuf(int fd, QemuOpts *opts)
 {
     return 0;
 }
+
+int tap_probe_vnet_hdr(int fd)
+{
+    return 0;
+}
index df2cfbe..3f6722e 100644 (file)
--- 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)
 {
index 0d67c24..de729a7 100644 (file)
--- 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 */