From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1G9xJm-0003OU-8Z for qemu-devel@nongnu.org; Mon, 07 Aug 2006 01:06:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1G9xJj-0003NX-VA for qemu-devel@nongnu.org; Mon, 07 Aug 2006 01:06:21 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G9xJj-0003NH-7i for qemu-devel@nongnu.org; Mon, 07 Aug 2006 01:06:19 -0400 Received: from [211.5.2.73] (helo=nm01omta015.dion.ne.jp) by monty-python.gnu.org with smtp (Exim 4.52) id 1G9xNt-0003iO-6m for qemu-devel@nongnu.org; Mon, 07 Aug 2006 01:10:37 -0400 Message-ID: <002b01c6b9df$3a53e4e0$0464a8c0@athlon> From: "Kazu" Subject: [Qemu-devel] Raw CD-ROM and hard disk for win32 Date: Mon, 7 Aug 2006 14:06:05 +0900 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0024_01C6BA2A.9F4C7A60" Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. ------=_NextPart_000_0024_01C6BA2A.9F4C7A60 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hi, An attached patch fixes raw CD-ROM and hard disk handling for win32. Qcow is not fixed. Regards, Kazu ------=_NextPart_000_0024_01C6BA2A.9F4C7A60 Content-Type: application/octet-stream; name="qemu-20060807-cdrom.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="qemu-20060807-cdrom.patch" Index: block-raw.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /sources/qemu/qemu/block-raw.c,v=0A= retrieving revision 1.6=0A= diff -u -r1.6 block-raw.c=0A= --- block-raw.c 7 Aug 2006 02:38:06 -0000 1.6=0A= +++ block-raw.c 7 Aug 2006 04:07:36 -0000=0A= @@ -455,12 +455,6 @@=0A= {=0A= size =3D lseek(fd, 0, SEEK_END);=0A= }=0A= -#ifdef _WIN32=0A= - /* On Windows hosts it can happen that we're unable to get file size=0A= - for CD-ROM raw device (it's inherent limitation of the CDFS = driver). */=0A= - if (size =3D=3D -1)=0A= - size =3D LONG_LONG_MAX;=0A= -#endif=0A= return size;=0A= }=0A= =0A= @@ -767,8 +761,11 @@=0A= LARGE_INTEGER l;=0A= =0A= l.LowPart =3D GetFileSize(s->hfile, &l.HighPart);=0A= - if (l.LowPart =3D=3D 0xffffffffUL && GetLastError() !=3D NO_ERROR)=0A= - return -EIO;=0A= + if (l.LowPart =3D=3D 0xffffffffUL && GetLastError() !=3D NO_ERROR) {=0A= + /* On Windows hosts it can happen that we're unable to get file size=0A= + for CD-ROM raw device (it's inherent limitation of the CDFS = driver). */=0A= + return LONG_LONG_MAX;=0A= + }=0A= return l.QuadPart;=0A= }=0A= =0A= Index: block.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /sources/qemu/qemu/block.c,v=0A= retrieving revision 1.32=0A= diff -u -r1.32 block.c=0A= --- block.c 7 Aug 2006 02:38:06 -0000 1.32=0A= +++ block.c 7 Aug 2006 04:07:37 -0000=0A= @@ -191,6 +191,10 @@=0A= /* specific win32 case for driver letters */=0A= return &bdrv_raw;=0A= }=0A= + if (len =3D=3D 5) {=0A= + /* win32 drive. CD-ROM etc. */=0A= + return &bdrv_raw;=0A= + }=0A= #endif =0A= memcpy(protocol, filename, len);=0A= protocol[len] =3D '\0';=0A= ------=_NextPart_000_0024_01C6BA2A.9F4C7A60--