Received: from eggs.gnu.org ([2001:4830:134:3::10]:52363) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGSSx-0003vp-Tl for qemu-devel@nongnu.org; Mon, 02 Sep 2013 07:38:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VGSSs-0000T8-PY for qemu-devel@nongnu.org; Mon, 02 Sep 2013 07:38:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36305) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGSSs-0000Sz-HI for qemu-devel@nongnu.org; Mon, 02 Sep 2013 07:38:38 -0400 From: Stefan Hajnoczi Date: Mon, 2 Sep 2013 13:38:30 +0200 Message-Id: <1378121913-30494-2-git-send-email-stefanha@redhat.com> In-Reply-To: <1378121913-30494-1-git-send-email-stefanha@redhat.com> References: <1378121913-30494-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PULL 1/4] tap: Use numbered tap/tun devices on all *BSD OS's List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Anthony Liguori From: Brad Smith 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 Signed-off-by: Stefan Hajnoczi --- 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