NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: qemu segmentation fault



On Wed, 16 Dec 2009 22:17:18 +0100
Victor Dorneanu <victor%dornea.nu@localhost> wrote:

> $ qemu -cdrom /home/cyneox/tmp/debian-503-i386-netinst.iso -net nic -net tap
> 
> and get:
> segmentation fault  qemu -cdrom
> /home/cyneox/tmp/debian-503-i386-netinst.iso -net nic -net tap
> 
> I've attached the ktrace dump. Does anybody have an idea how I could
> solve this?

How old is qemu? at version 0.8.1 there was a problem using tap for NetBSD. I 
see I had a number of patches, maybe the attached one would help.

-- 
Cliff Wright <cliff%snipe444.org@localhost>
--- vl.c.sav    2007-09-14 17:28:52.000000000 -0700
+++ vl.c        2007-09-18 14:30:18.000000000 -0700
@@ -46,7 +46,12 @@
 #include <dirent.h>
 #include <netdb.h>
 #ifdef _BSD
+#ifdef __NetBSD__
+#include <net/if.h>
+#include <net/if_tap.h>
+#else
 #include <sys/stat.h>
+#endif
 #ifndef _BSD
 #include <libutil.h>
 #endif
@@ -2570,7 +2575,11 @@
 {
     int fd;
     char *dev;
+#ifdef __NetBSD__
+    struct ifreq tapif;
+#else
     struct stat s;
+#endif
 
     fd = open("/dev/tap", O_RDWR);
     if (fd < 0) {
@@ -2578,8 +2587,13 @@
         return -1;
     }
 
+#ifdef __NetBSD__
+    ioctl(fd, TAPGIFNAME, &tapif);
+    dev = tapif.ifr_name;
+#else
     fstat(fd, &s);
     dev = devname(s.st_rdev, S_IFCHR);
+#endif
     pstrcpy(ifname, ifname_size, dev);
 
     fcntl(fd, F_SETFL, O_NONBLOCK);


Home | Main Index | Thread Index | Old Index