From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BVfZQ-0008JM-W0 for qemu-devel@nongnu.org; Wed, 02 Jun 2004 19:54:57 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BVfZP-0008J8-9y for qemu-devel@nongnu.org; Wed, 02 Jun 2004 19:54:56 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BVfZP-0008J5-4m for qemu-devel@nongnu.org; Wed, 02 Jun 2004 19:54:55 -0400 Received: from [81.209.184.159] (helo=dd2718.kasserver.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BVfZ4-0006XY-I4 for qemu-devel@nongnu.org; Wed, 02 Jun 2004 19:54:34 -0400 Received: from [192.168.0.7] (dsl-082-082-145-081.arcor-ip.net [82.82.145.81]) by dd2718.kasserver.com (Postfix) with ESMTP id 664F792598 for ; Thu, 3 Jun 2004 01:52:49 +0200 (CEST) Message-ID: <40BE68D3.5030006@fabianowski.de> Date: Thu, 03 Jun 2004 01:54:59 +0200 From: Bartosz Fabianowski MIME-Version: 1.0 References: <40B90DB2.3040508@fabianowski.de> <1085872155.93476.18.camel@pcgem.rdg.cyberkinetica.com> <20040530102509.0f234b19.markus.niemisto@gmx.net> <1085910613.94556.3.camel@pcgem.rdg.cyberkinetica.com> <40B9F2A3.5000707@fabianowski.de> <1085938065.347.1.camel@pcgem.rdg.cyberkinetica.com> <40BA2EA1.7020104@fabianowski.de> <1085947772.347.5.camel@pcgem.rdg.cyberkinetica.com> <40BA7E1A.5080005@fabianowski.de> <1085966664.347.8.camel@pcgem.rdg.cyberkinetica.com> <20040603011805.A40432@saturn.kn-bremen.de> In-Reply-To: <20040603011805.A40432@saturn.kn-bremen.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: qemu port Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org > OK, I've now taken this and the other FreeBSD patches, added a few > small ones of my own and made a port [...] Awesome! A port was my original idea and the reason for why I started tinkering with QEMU in the first place. > - needs to run as root in order to use /dev/tap* networking (why?) I haven't looked at your port yet, but my own compilation of QEMU has the same problem. It seems to me that this is because on each invocation, QEMU creates a new tap device. Just run QEMU a few times (as root) and then look at the output of ifconfig. Each invocation will have produced a new tap device. Since normal users probably have no permission to create device nodes, QEMU fails to create its required tap device and therefore tap networking doesn't work. A fix for this would be to create a certain amount of tap device nodes at FreeBSD start up and then to have QEMU recycle the nodes it doesn't need any more. Then again, maybe I am totally wrong on what is causing this. > - using physical media doesn't work on 4.x hosts (missing > DIOCGMEDIASIZE ioctl) This is the place where it's actually used: if (ioctl(fd, DIOCGMEDIASIZE, (off_t *)&size)) size = lseek(fd, 0LL, SEEK_END); This ioctl checks whether the total size of the medium can be retrieved and thus only succeeds if there is a medium in the drive. So the ioctl effectively just checks whether there is a medium. The size is then retrieved separately using lseek. I haven't tried compiling or running this, but my idea would be to try something like this instead: if((size = lseek(fd, 0LL, SEEK_END)) < 0) size = 0; Now, lseek is always called. If there is no medium, lseek should fail, returning some negative value. In this case, the size is set to zero to indicate failure. Otherwise, the size determined by lseek is used. - Bartosz