From: Kevin Wolf <kwolf@redhat.com>
To: aliguori@linux.vnet.ibm.com
Cc: kwolf@redhat.com, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 09/11] block: Fix protocol detection for Windows devices
Date: Fri, 7 May 2010 17:14:05 +0200 [thread overview]
Message-ID: <1273245247-24827-10-git-send-email-kwolf@redhat.com> (raw)
In-Reply-To: <1273245247-24827-1-git-send-email-kwolf@redhat.com>
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>
---
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
next prev parent reply other threads:[~2010-05-07 15:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-07 15:13 [Qemu-devel] [PULL 00/11] Block patches Kevin Wolf
2010-05-07 15:13 ` [Qemu-devel] [PATCH 01/11] block: Remove semicolon in BDRV_SECTOR_MASK macro Kevin Wolf
2010-05-07 15:13 ` [Qemu-devel] [PATCH 02/11] qemu-nbd: Improve error reporting Kevin Wolf
2010-05-07 15:13 ` [Qemu-devel] [PATCH 03/11] cloop: use pread Kevin Wolf
2010-05-07 15:14 ` [Qemu-devel] [PATCH 04/11] cloop: use qemu block API Kevin Wolf
2010-05-07 15:14 ` [Qemu-devel] [PATCH 05/11] ide: Fix ide_dma_cancel Kevin Wolf
2010-05-07 15:14 ` [Qemu-devel] [PATCH 06/11] bochs: use pread Kevin Wolf
2010-05-07 15:14 ` [Qemu-devel] [PATCH 07/11] bochs: use qemu block API Kevin Wolf
2010-05-07 15:14 ` [Qemu-devel] [PATCH 08/11] block: Avoid unchecked casts for AIOCBs Kevin Wolf
2010-05-07 15:14 ` Kevin Wolf [this message]
2010-05-07 15:14 ` [Qemu-devel] [PATCH 10/11] block: Fix bdrv_commit Kevin Wolf
2010-05-07 15:14 ` [Qemu-devel] [PATCH 11/11] block/vdi: Allow disk images of size 0 Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1273245247-24827-10-git-send-email-kwolf@redhat.com \
--to=kwolf@redhat.com \
--cc=aliguori@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).