Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BWJxY-0006FU-Is for qemu-devel@nongnu.org; Fri, 04 Jun 2004 15:02:32 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BWJxX-0006FD-9W for qemu-devel@nongnu.org; Fri, 04 Jun 2004 15:02:32 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BWJxX-0006Ew-56 for qemu-devel@nongnu.org; Fri, 04 Jun 2004 15:02:31 -0400 Received: from [212.63.36.242] (helo=gwyn.kn-bremen.de) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1BWJwE-0001Es-S9 for qemu-devel@nongnu.org; Fri, 04 Jun 2004 15:01:11 -0400 From: Juergen Lock Date: Fri, 4 Jun 2004 20:44:06 +0200 Subject: Re: [Qemu-devel] Re: qemu port Message-ID: <20040604204406.A95786@saturn.kn-bremen.de> References: <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> <40BE68D3.5030006@fabianowski.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <40BE68D3.5030006@fabianowski.de> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bartosz Fabianowski Cc: qemu-devel@nongnu.org On Thu, Jun 03, 2004 at 12:21:27AM +0000, Bartosz Fabianowski wrote: > > 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. ... Problem solved: its a redundant(?) uid check in the if_tap module (btw at least on 4.9 i have to cycle thru the available /dev/tap[0123] device nodes myself, see patch-bt) > > - 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. >... Heh. :) No. ioctl() returns 0 on success not on failure, so only if the ioctl fails is the size retrieved via lseek (and this lseek method doesnt work on pyhsical devices, therefore the ioctl.) Juergen