From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39053) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHy31-0006GU-4R for qemu-devel@nongnu.org; Fri, 06 Sep 2013 11:34:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VHy2w-0003fJ-6j for qemu-devel@nongnu.org; Fri, 06 Sep 2013 11:34:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20850) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHy2v-0003fC-VM for qemu-devel@nongnu.org; Fri, 06 Sep 2013 11:34:06 -0400 From: Stefan Hajnoczi Date: Fri, 6 Sep 2013 17:33:40 +0200 Message-Id: <1378481624-20964-2-git-send-email-stefanha@redhat.com> In-Reply-To: <1378481624-20964-1-git-send-email-stefanha@redhat.com> References: <1378481624-20964-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PULL v2 1/5] 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: Stefan Hajnoczi , Anthony Liguori , Brad Smith 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