* [Qemu-devel] floppy read of incomplete sectors
@ 2004-08-05 9:09 Jani Monoses
0 siblings, 0 replies; only message in thread
From: Jani Monoses @ 2004-08-05 9:09 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 225 bytes --]
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
[-- Attachment #2: ,block.diff --]
[-- Type: text/x-diff, Size: 630 bytes --]
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,
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-08-05 9:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-05 9:09 [Qemu-devel] floppy read of incomplete sectors Jani Monoses
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).