Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BseKE-0007sx-Qw for qemu-devel@nongnu.org; Thu, 05 Aug 2004 05:14:14 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BseKC-0007sD-RE for qemu-devel@nongnu.org; Thu, 05 Aug 2004 05:14:14 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BseKC-0007sA-If for qemu-devel@nongnu.org; Thu, 05 Aug 2004 05:14:12 -0400 Received: from [194.105.28.94] (helo=iv.ro) by monty-python.gnu.org with smtp (Exim 4.34) id 1BseFk-0001IH-Sj for qemu-devel@nongnu.org; Thu, 05 Aug 2004 05:09:37 -0400 Date: Thu, 5 Aug 2004 12:09:34 +0300 From: Jani Monoses Message-Id: <20040805120934.62dcfd85.jani@iv.ro> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Thu__5_Aug_2004_12_09_34_+0300_7KlWaPiKbfb_/JuM" Subject: [Qemu-devel] floppy read of incomplete sectors 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 This is a multi-part message in MIME format. --Multipart=_Thu__5_Aug_2004_12_09_34_+0300_7KlWaPiKbfb_/JuM Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit The same issue of two weeks ago, causing some apps to fail because the last sector is not being read if the file serving as floppy image is not a multiple of 512 bytes. The patch is against CVS, the new raw_block code. Jani --Multipart=_Thu__5_Aug_2004_12_09_34_+0300_7KlWaPiKbfb_/JuM Content-Type: text/x-diff; name=",block.diff" Content-Disposition: attachment; filename=",block.diff" Content-Transfer-Encoding: 7bit Index: block.c =================================================================== RCS file: /cvsroot/qemu/qemu/block.c,v retrieving revision 1.12 diff -u -p -5 -r1.12 block.c --- block.c 3 Aug 2004 21:14:09 -0000 1.12 +++ block.c 5 Aug 2004 09:03:15 -0000 @@ -534,11 +534,11 @@ static int raw_read(BlockDriverState *bs BDRVRawState *s = bs->opaque; int ret; lseek(s->fd, sector_num * 512, SEEK_SET); ret = read(s->fd, buf, nb_sectors * 512); - if (ret != nb_sectors * 512) + if (ret == -1) return -1; return 0; } static int raw_write(BlockDriverState *bs, int64_t sector_num, --Multipart=_Thu__5_Aug_2004_12_09_34_+0300_7KlWaPiKbfb_/JuM--