From: Jani Monoses <jani@iv.ro>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] QEMU floppy problems (was: ecos and qemu)
Date: Fri, 23 Jul 2004 18:12:28 +0300 [thread overview]
Message-ID: <20040723181228.4eee1763.jani@iv.ro> (raw)
In-Reply-To: <Pine.LNX.4.56.0407231704350.2090@hatatitla.NotaMusica.com>
[-- Attachment #1: Type: text/plain, Size: 80 bytes --]
and this patch fixes it :)
it's ugly though...
does it work for you guys?
Jani
[-- Attachment #2: ,l.diff --]
[-- Type: text/x-diff, Size: 1045 bytes --]
Index: block.c
===================================================================
RCS file: /cvsroot/qemu/qemu/block.c,v
retrieving revision 1.10
diff -u -r1.10 block.c
--- block.c 14 Jul 2004 17:20:30 -0000 1.10
+++ block.c 23 Jul 2004 15:12:21 -0000
@@ -311,6 +311,7 @@
{
int ret, n, fd;
int64_t offset;
+ int bytes = 512;
if (!bs->inserted)
return -1;
@@ -320,7 +321,7 @@
fd = bs->cow_fd;
offset = bs->cow_sectors_offset;
} else if (sector_num == 0 && bs->boot_sector_enabled) {
- memcpy(buf, bs->boot_sector_data, 512);
+ memcpy(buf, bs->boot_sector_data, bytes);
n = 1;
goto next;
} else {
@@ -335,8 +336,11 @@
offset += sector_num * 512;
lseek64(fd, offset, SEEK_SET);
ret = read(fd, buf, n * 512);
+
if (ret != n * 512) {
- return -1;
+ if (ret == -1)
+ return -1;
+ bytes = ret;
}
}
next:
next prev parent reply other threads:[~2004-07-23 15:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-23 8:14 [Qemu-devel] ecos and qemu Jani Monoses
2004-07-23 15:01 ` [Qemu-devel] " Ben Pfaff
2004-07-23 15:05 ` Jani Monoses
2004-07-23 15:08 ` [Qemu-devel] QEMU floppy problems (was: ecos and qemu) Johannes Martin
2004-07-23 15:12 ` Jani Monoses [this message]
2004-07-23 15:24 ` [Qemu-devel] Re: QEMU floppy problems Ben Pfaff
2004-07-30 10:01 ` [Qemu-devel] QEMU floppy problems (was: ecos and qemu) Johannes Martin
2004-07-30 10:06 ` Jani Monoses
2004-07-30 18:56 ` SPAM[RBL] Re: [Qemu-devel] QEMU floppy problems Leonardo Marques de Souza
2004-07-23 15:14 ` [Qemu-devel] QEMU floppy problems (was: ecos and qemu) Jani Monoses
2004-07-23 15:51 ` Johannes Martin
2004-07-23 15:27 ` [Qemu-devel] Re: QEMU floppy problems Ben Pfaff
2004-07-23 16:03 ` [Qemu-devel] QEMU floppy problems (was: ecos and qemu) Karel Gardas
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=20040723181228.4eee1763.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).