Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C718w-0000mP-Uz for qemu-devel@nongnu.org; Mon, 13 Sep 2004 20:25:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C718v-0000lr-8C for qemu-devel@nongnu.org; Mon, 13 Sep 2004 20:25:57 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C718u-0000lY-Vl for qemu-devel@nongnu.org; Mon, 13 Sep 2004 20:25:57 -0400 Received: from [80.219.160.10] (helo=hampa.ch) by monty-python.gnu.org with smtp (Exim 4.34) id 1C7132-0003ri-2V for qemu-devel@nongnu.org; Mon, 13 Sep 2004 20:19:52 -0400 Date: Tue, 14 Sep 2004 02:19:47 +0200 From: Hampa Hug Subject: Re: [Qemu-devel] [PATCH] DOSEMU image file support Message-Id: <20040914021947.06333bf9.hampa@hampa.ch> In-Reply-To: <41375469.9050508@bellard.org> References: <20040902171512.61266d0e.hampa@hampa.ch> <4137454D.8080202@bellard.org> <20040902190014.33359ecd.hampa@hampa.ch> <41375469.9050508@bellard.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 Fabrice Bellard wrote: > Hampa Hug wrote: > > Fabrice Bellard wrote: > >>Thank you for the patch. Two remarks if you want that I merge it: > >> > >>1) use open/read/write/close instead of fopen/fread/fwrite/fclose for > >>consistency with other block drivers. > > > > > > The reason I used stdio is that read/write are non-blocking. It is > > not an error for read to return fewer bytes than requested. If that > > happens, the other block drivers fail. > > I agree, but for disk accesses it is usual to assume they return the > requested amount of bytes. fread/fwrite are buffered I/Os which is a bit > overkill for block drivers. I don't think that buffered I/O is an issue here. We are doing fread/fwrite of multiples of 512 byte blocks and most implementations don't actually buffer these. I am reluctant to just use read/write (as the other block drivers do) because it is simply wrong. It may work for local files under Linux, but what about remote files (such as files on NFS mounts) and other host operating systems? At the very least we should write small wrapper functions for read and write that fail only if there was an error. > >>2) change the license to BSD > > > > I was under the impression that we used GPL. At least that's what > > COPYING says. > > The different parts of QEMU have different licenses (and of course it > affects the license of the resulting program). As mentionned on the web > page: > > - The QEMU virtual CPU core library is released under the GNU Lesser > General Public License. > - The Linux QEMU emulator is released under the GNU General Public License. > - The QEMU PC system emulator is released under the MIT/BSD License. > > The block layer belongs to the QEMU PC system emulator, so its license > is BSD. Alright, I'll change that. cheers Hampa