From: Jani Monoses <jani@iv.ro>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] floppy read of incomplete sectors
Date: Thu, 5 Aug 2004 12:09:34 +0300 [thread overview]
Message-ID: <20040805120934.62dcfd85.jani@iv.ro> (raw)
[-- 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,
reply other threads:[~2004-08-05 9:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040805120934.62dcfd85.jani@iv.ro \
--to=jani@iv.ro \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).