From: aliguori Date: Tue, 7 Apr 2009 01:46:18 +0000 (+0000) Subject: Fix find_device_type() to correctly identify floppy disk devices; (Luca Tettamanti) X-Git-Tag: xen-3.4.0-rc2~1^2~4 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=b7d11af2e0b7bd0fcd2920cfcbe335f98b29f800;p=qemu-xen-4.0-testing.git Fix find_device_type() to correctly identify floppy disk devices; (Luca Tettamanti) they are reported as DRIVE_REMOVABLE by win32. Signed-off-by: Luca Tettamanti git-svn-id: svn://svn.savannah.nongnu.org/qemu/branches/stable_0_10@7011 c046a42c-6fe2-441c-8c8c-71466251a162 --- diff --git a/block-raw-win32.c b/block-raw-win32.c index 892f2d1e..04d011c4 100644 --- a/block-raw-win32.c +++ b/block-raw-win32.c @@ -399,10 +399,15 @@ static int find_device_type(BlockDriverState *bs, const char *filename) return FTYPE_HARDDISK; snprintf(s->drive_path, sizeof(s->drive_path), "%c:\\", p[0]); type = GetDriveType(s->drive_path); - if (type == DRIVE_CDROM) + switch (type) { + case DRIVE_REMOVABLE: + case DRIVE_FIXED: + return FTYPE_HARDDISK; + case DRIVE_CDROM: return FTYPE_CD; - else + default: return FTYPE_FILE; + } } else { return FTYPE_FILE; }