qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Stefan Hajnoczi <stefanha@redhat.com>,
	Anthony Liguori <anthony@codemonkey.ws>,
	Brad Smith <brad@comstyle.com>
Subject: [Qemu-devel] [PULL v2 1/5] tap: Use numbered tap/tun devices on all *BSD OS's
Date: Fri,  6 Sep 2013 17:33:40 +0200	[thread overview]
Message-ID: <1378481624-20964-2-git-send-email-stefanha@redhat.com> (raw)
In-Reply-To: <1378481624-20964-1-git-send-email-stefanha@redhat.com>

From: Brad Smith <brad@comstyle.com>

The following patch simplifies the *BSD tap/tun code and makes use of numbered
tap/tun interfaces on all *BSD OS's. NetBSD has a patch in their pkgsrc tree
to make use of this feature and DragonFly also supports this as well.

Signed-off-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 net/tap-bsd.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/net/tap-bsd.c b/net/tap-bsd.c
index f61d580..90f8a02 100644
--- a/net/tap-bsd.c
+++ b/net/tap-bsd.c
@@ -44,8 +44,6 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
     struct stat s;
 #endif
 
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
-    defined(__OpenBSD__) || defined(__APPLE__)
     /* if no ifname is given, always start the search from tap0/tun0. */
     int i;
     char dname[100];
@@ -76,15 +74,6 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
                    dname, strerror(errno));
         return -1;
     }
-#else
-    TFR(fd = open("/dev/tap", O_RDWR));
-    if (fd < 0) {
-        fprintf(stderr,
-            "warning: could not open /dev/tap: no virtual network emulation: %s\n",
-            strerror(errno));
-        return -1;
-    }
-#endif
 
 #ifdef TAPGIFNAME
     if (ioctl(fd, TAPGIFNAME, (void *)&ifr) < 0) {
-- 
1.8.3.1

  reply	other threads:[~2013-09-06 15:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-06 15:33 [Qemu-devel] [PULL v2 0/5] Net patches Stefan Hajnoczi
2013-09-06 15:33 ` Stefan Hajnoczi [this message]
2013-09-06 15:33 ` [Qemu-devel] [PULL v2 2/5] net: Rename send_queue to incoming_queue Stefan Hajnoczi
2013-09-06 15:33 ` [Qemu-devel] [PULL v2 3/5] e1000: add interrupt mitigation support Stefan Hajnoczi
2013-09-06 15:33 ` [Qemu-devel] [PULL v2 4/5] vmxnet3: Eliminate __packed redefined warning Stefan Hajnoczi
2013-09-06 15:33 ` [Qemu-devel] [PULL v2 5/5] ne2000: mark I/O as LITTLE_ENDIAN Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1378481624-20964-2-git-send-email-stefanha@redhat.com \
    --to=stefanha@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=brad@comstyle.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).