qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Raw CD-ROM and hard disk for win32
@ 2006-08-07  5:06 Kazu
  2006-08-07 18:31 ` Fabrice Bellard
  0 siblings, 1 reply; 3+ messages in thread
From: Kazu @ 2006-08-07  5:06 UTC (permalink / raw)
  To: qemu-devel

[-- 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';

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-08-09  6:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-07  5:06 [Qemu-devel] Raw CD-ROM and hard disk for win32 Kazu
2006-08-07 18:31 ` Fabrice Bellard
2006-08-09  6:36   ` Kazu

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).