From: "Kazu" <kazoo@r3.dion.ne.jp>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] block-vvfat RW patch
Date: Tue, 5 Sep 2006 18:36:02 +0900 [thread overview]
Message-ID: <001c01c6d0ce$b494aa40$0464a8c0@athlon> (raw)
In-Reply-To: 002a01c6d07d$e1c98e50$7d00a8c0@DELL3G
Hi,
I confirmed it works. Thank you.
Regards,
Kazu
Sent: Tuesday, September 05, 2006 8:57 AM Roger Lathrop wrote:
> Attached patch fixes 3 issues I found while trying to write files from
guest
> to a vfat drive using this configuration:
> Host: Windows XP (NTFS)
> Guest: DOS 5 (yeah, really!)
> Compiler: gcc version 3.4.2 (mingw-special)
> Qemu Version: 0.8.2
> Command line: qemu ....-hdb fat:rw:c:\dev\qemu\work...
>
> Problem: Qemu would fault when copying files from guest to d:\
>
> Changes:
>
> 1) Fixed assert macro for mingw. Original causes spurious faults when
> there's a dangling else after the assert.
> 2) Added O_BINARY to open call in commit_one_file(). Without it, binary
> files get LF-->CR/LF translations on Windows.
> 3) Changed sector2cluster to return a signed int, and added type casts to
> force the division to be signed.
>
> First 2 changes are straight forward and should be safe. 3'rd solved my
> problem, but should be looked at by someone who understands vvfat better
> than me. I've only tested on the above configuration.
> The problem I saw was DOS writing to sectors less than s->faked_sectors.
The
> unsigned divide returned a large positive number, which would fault in
this
> bit of code in vvfat_write:
> if (i >= 0)
> s->used_clusters[i] |= USED_ALLOCATED;
>
> This fix seems reasonable, since the callers of sector2cluster seem to
> expect a signed result. I suppose an alternate fix would be to test for
the
> special case and always return -1. But I hate special cases ;-)
>
> Patch is against 0.8.2, not current CVS, sorry. Doesn't appear to have
been
> fixed since 0.8.2
>
> Good to have this working. Our app is an embedded system with really crude
> (read, no TCP/IP) network support. Until now, getting log files off the
> guest has been a pain. So, a big THANKS to whoever wrote block-vvfat,
> despite the little buglets.
>
> Roger
next prev parent reply other threads:[~2006-09-05 9:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-04 23:57 [Qemu-devel] block-vvfat RW patch Roger Lathrop
2006-09-05 9:36 ` Kazu [this message]
2006-09-09 12:05 ` Fabrice Bellard
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='001c01c6d0ce$b494aa40$0464a8c0@athlon' \
--to=kazoo@r3.dion.ne.jp \
--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).