[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 09/21] block: Fix protocol detection for Windows dev
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 09/21] block: Fix protocol detection for Windows devices |
Date: |
Fri, 14 May 2010 19:10:43 +0200 |
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 <address@hidden>
---
block.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/block.c b/block.c
index 6345599..977d01f 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");
--
1.6.6.1
- [Qemu-devel] [PULL 00/21] Block patches, Kevin Wolf, 2010/05/14
- [Qemu-devel] [PATCH 01/21] block: Remove semicolon in BDRV_SECTOR_MASK macro, Kevin Wolf, 2010/05/14
- [Qemu-devel] [PATCH 04/21] cloop: use qemu block API, Kevin Wolf, 2010/05/14
- [Qemu-devel] [PATCH 05/21] ide: Fix ide_dma_cancel, Kevin Wolf, 2010/05/14
- [Qemu-devel] [PATCH 09/21] block: Fix protocol detection for Windows devices,
Kevin Wolf <=
- [Qemu-devel] [PATCH 07/21] bochs: use qemu block API, Kevin Wolf, 2010/05/14
- [Qemu-devel] [PATCH 03/21] cloop: use pread, Kevin Wolf, 2010/05/14
- [Qemu-devel] [PATCH 08/21] block: Avoid unchecked casts for AIOCBs, Kevin Wolf, 2010/05/14
- [Qemu-devel] [PATCH 06/21] bochs: use pread, Kevin Wolf, 2010/05/14
- [Qemu-devel] [PATCH 12/21] parallels: use pread, Kevin Wolf, 2010/05/14
- [Qemu-devel] [PATCH 13/21] parallels: use qemu block API, Kevin Wolf, 2010/05/14
- [Qemu-devel] [PATCH 11/21] block/vdi: Allow disk images of size 0, Kevin Wolf, 2010/05/14
- [Qemu-devel] [PATCH 15/21] dmg: fix reading of uncompressed chunks, Kevin Wolf, 2010/05/14
- [Qemu-devel] [PATCH 14/21] block/vpc: Fix conversion from size to disk geometry, Kevin Wolf, 2010/05/14
- [Qemu-devel] [PATCH 02/21] qemu-nbd: Improve error reporting, Kevin Wolf, 2010/05/14