[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] r6677 broke access to physical FDD on Win32
From: |
Luca Tettamanti |
Subject: |
Re: [Qemu-devel] r6677 broke access to physical FDD on Win32 |
Date: |
Sat, 21 Mar 2009 23:07:38 +0100 |
On Fri, Mar 20, 2009 at 11:01 PM, Anthony Liguori <address@hidden> wrote:
> Robert Riebisch wrote:
>>
>> Hi!
>>
>> If I run QEMU on Win32 with option "-fda a:", then I'm unable to access
>> physical floppies from guest OS. "Physical" also includes virtual drives
>> created by <http://chitchat.at.infoseek.co.jp/vmware/vfd.html>.
>>
>> I'm also unable to boot such floppies ("-boot a"). Error message is:
>> "Boot failed: not a bootable floppy disk"
>>
>> By doing some builds I narrowed the problem down to
>> <http://svn.savannah.gnu.org/viewvc?view=rev&root=qemu&revision=6677> by
>> Anthony Liguori.
>>
>
> I suspect this code:
>
> block-raw-win32.c:raw_getlength():
>
> case FTYPE_HARDDISK:
> status = DeviceIoControl(s->hfile, IOCTL_DISK_GET_DRIVE_GEOMETRY_EX,
> NULL, 0, &dg, sizeof(dg), &count, NULL);
> if (status != 0) {
> l = dg.DiskSize;
> }
> break;
>
> Is not doing the correct thing.
Sort of; the real problem is in find_device_type(), it thinks that the
device is a file :S
The bug is here:
type = GetDriveType(s->drive_path);
if (type == DRIVE_CDROM)
return FTYPE_CD;
else
return FTYPE_FILE;
GetDriveType("a:") returns DRIVE_REMOVABLE, which according to MSDN
means "The drive has removable media; for example, a floppy drive,
thumb drive, or flash card reader."; the code is not expecting such a
value so it sets the type to FTYPE_FILE; raw_getlength() then uses
GetFileSize() which of course fails...
Here's a patch for properly handling the return value of GetDriveType
(sorry for the attachment, but I'm currently using a remote VM over
RDP and don't have a decent mailer installed).
Luca
fix-fda.diff
Description: Binary data
- Re: [Qemu-devel] r6677 broke access to physical FDD on Win32, (continued)
- Re: [Qemu-devel] r6677 broke access to physical FDD on Win32, Anthony Liguori, 2009/03/20
- Re: [Qemu-devel] r6677 broke access to physical FDD on Win32, Robert Riebisch, 2009/03/20
- Re: [Qemu-devel] r6677 broke access to physical FDD on Win32, Anthony Liguori, 2009/03/20
- Re: [Qemu-devel] r6677 broke access to physical FDD on Win32, Luca Tettamanti, 2009/03/20
- Re: [Qemu-devel] r6677 broke access to physical FDD on Win32, Anthony Liguori, 2009/03/20
- Re: [Qemu-devel] r6677 broke access to physical FDD on Win32, Robert Riebisch, 2009/03/22
- Re: [Qemu-devel] r6677 broke access to physical FDD on Win32, Anthony Liguori, 2009/03/22
- Re: [Qemu-devel] r6677 broke access to physical FDD on Win32, Luca Tettamanti, 2009/03/23
- Re: [Qemu-devel] r6677 broke access to physical FDD on Win32, Japheth, 2009/03/24
- Re: [Qemu-devel] r6677 broke access to physical FDD on Win32, Robert Riebisch, 2009/03/30
Re: [Qemu-devel] r6677 broke access to physical FDD on Win32,
Luca Tettamanti <=