From: "Kazu" <kazoo@r3.dion.ne.jp>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Raw CD-ROM and hard disk for win32
Date: Mon, 7 Aug 2006 14:06:05 +0900 [thread overview]
Message-ID: <002b01c6b9df$3a53e4e0$0464a8c0@athlon> (raw)
[-- Attachment #1: Type: text/plain, Size: 108 bytes --]
Hi,
An attached patch fixes raw CD-ROM and hard disk handling for win32.
Qcow is not fixed.
Regards,
Kazu
[-- Attachment #2: qemu-20060807-cdrom.patch --]
[-- Type: application/octet-stream, Size: 1646 bytes --]
Index: block-raw.c
===================================================================
RCS file: /sources/qemu/qemu/block-raw.c,v
retrieving revision 1.6
diff -u -r1.6 block-raw.c
--- block-raw.c 7 Aug 2006 02:38:06 -0000 1.6
+++ block-raw.c 7 Aug 2006 04:07:36 -0000
@@ -455,12 +455,6 @@
{
size = lseek(fd, 0, SEEK_END);
}
-#ifdef _WIN32
- /* On Windows hosts it can happen that we're unable to get file size
- for CD-ROM raw device (it's inherent limitation of the CDFS driver). */
- if (size == -1)
- size = LONG_LONG_MAX;
-#endif
return size;
}
@@ -767,8 +761,11 @@
LARGE_INTEGER l;
l.LowPart = GetFileSize(s->hfile, &l.HighPart);
- if (l.LowPart == 0xffffffffUL && GetLastError() != NO_ERROR)
- return -EIO;
+ if (l.LowPart == 0xffffffffUL && GetLastError() != NO_ERROR) {
+ /* On Windows hosts it can happen that we're unable to get file size
+ for CD-ROM raw device (it's inherent limitation of the CDFS driver). */
+ return LONG_LONG_MAX;
+ }
return l.QuadPart;
}
Index: block.c
===================================================================
RCS file: /sources/qemu/qemu/block.c,v
retrieving revision 1.32
diff -u -r1.32 block.c
--- block.c 7 Aug 2006 02:38:06 -0000 1.32
+++ block.c 7 Aug 2006 04:07:37 -0000
@@ -191,6 +191,10 @@
/* specific win32 case for driver letters */
return &bdrv_raw;
}
+ if (len == 5) {
+ /* win32 drive. CD-ROM etc. */
+ return &bdrv_raw;
+ }
#endif
memcpy(protocol, filename, len);
protocol[len] = '\0';
next reply other threads:[~2006-08-07 5:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-07 5:06 Kazu [this message]
2006-08-07 18:31 ` [Qemu-devel] Raw CD-ROM and hard disk for win32 Fabrice Bellard
2006-08-09 6:36 ` Kazu
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='002b01c6b9df$3a53e4e0$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).