From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Dxm63-0007It-NN for qemu-devel@nongnu.org; Wed, 27 Jul 2005 09:37:19 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Dxm5z-0007Gw-Fl for qemu-devel@nongnu.org; Wed, 27 Jul 2005 09:37:16 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dxm5z-0007Fc-3T for qemu-devel@nongnu.org; Wed, 27 Jul 2005 09:37:15 -0400 Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1DxmBG-0000Gz-43 for qemu-devel@nongnu.org; Wed, 27 Jul 2005 09:42:42 -0400 Received: from root by ciao.gmane.org with local (Exim 4.43) id 1DxlzI-0007j4-Ip for qemu-devel@nongnu.org; Wed, 27 Jul 2005 15:30:20 +0200 Received: from iv.ro ([194.105.28.94]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 27 Jul 2005 15:30:20 +0200 Received: from jani by iv.ro with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 27 Jul 2005 15:30:20 +0200 From: Jani Monoses Date: Wed, 27 Jul 2005 16:18:19 +0300 Message-ID: References: <20050727111057.GA21694@gsy2.lepton.home> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit In-Reply-To: <20050727111057.GA21694@gsy2.lepton.home> Sender: news Subject: [Qemu-devel] Re: [patch]Fix block device read for some SLOW file 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 lepton wrote: > Hi, I found when I am using qemu, I can't boot from emulated cdrom. > After some debug, I found the reason is that my iso file is in a samba > file system. When qemu read data from my samba file system. read will be > interrupted by signal alarm. So qemu won't boot from it. > > The follwing patch will fix it. > > --- qemu-0.7.1/block.c 2005-07-25 02:52:08.000000000 +0800 > +++ qemu-0.7.1-lepton/block.c 2005-07-27 18:57:21.000000000 +0800 > @@ -591,10 +591,16 @@ static int raw_read(BlockDriverState *bs > int ret; > > lseek(s->fd, sector_num * 512, SEEK_SET); > - ret = read(s->fd, buf, nb_sectors * 512); > - if (ret != nb_sectors * 512) > - return -1; > - return 0; There's another error related to this code: qemu won't boot floppy images whose size isn't a multiple of 512, it will drop the last incomplete sector, as the last read will not give 512 bytes. a good testcase is the asmutils linux floppy image. Jani