aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2010-05-06 13:04:58 +0200
committerKevin Wolf <kwolf@redhat.com>2010-05-17 10:20:05 +0200
commit209930818bc0bb1400fbfa7d6448066c1b9e7b4c (patch)
treeea8f9b407856fbb770db85aefd509633c92b23c7 /block.c
parentb666d239509a0855740444c254a65cbf567bfb90 (diff)
block: Fix protocol detection for Windows devices
We can't assume the file protocol for Windows devices, they need the same detection as other files for which an explicit protocol is not specified. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/block.c b/block.c
index 6345599de2..977d01f74e 100644
--- a/block.c
+++ b/block.c
@@ -287,16 +287,18 @@ static BlockDriver *find_protocol(const char *filename)
char protocol[128];
int len;
const char *p;
+ int is_drive;
/* TODO Drivers without bdrv_file_open must be specified explicitly */
#ifdef _WIN32
- if (is_windows_drive(filename) ||
- is_windows_drive_prefix(filename))
- return bdrv_find_format("file");
+ is_drive = is_windows_drive(filename) ||
+ is_windows_drive_prefix(filename);
+#else
+ is_drive = 0;
#endif
p = strchr(filename, ':');
- if (!p) {
+ if (!p || is_drive) {
drv1 = find_hdev_driver(filename);
if (!drv1) {
drv1 = bdrv_find_format("file");