From: Christoph Hellwig <hch@lst.de>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] block: allow filenames with colons again for host devices
Date: Wed, 23 Jun 2010 12:25:17 +0200 [thread overview]
Message-ID: <20100623102517.GA11292@lst.de> (raw)
Before the raw/file split we used to allow filenames with colons for host
device only. While this was more by accident than by design people rely
on it, so we need to bring it back.
So move the host device probing to be before the protocol detection
again.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: qemu/block.c
===================================================================
--- qemu.orig/block.c 2010-06-23 12:16:52.599254111 +0200
+++ qemu/block.c 2010-06-23 12:20:31.423254251 +0200
@@ -288,23 +288,30 @@ BlockDriver *bdrv_find_protocol(const ch
char protocol[128];
int len;
const char *p;
- int is_drive;
/* TODO Drivers without bdrv_file_open must be specified explicitly */
+ /*
+ * XXX(hch): we really should not let host device detection
+ * override an explicit protocol specification, but moving this
+ * later breaks access to device names with colons in them.
+ * Thanks to the brain-dead persistent naming schemes on udev-
+ * based Linux systems those actually are quite common.
+ */
+ drv1 = find_hdev_driver(filename);
+ if (drv1) {
+ return drv1;
+ }
+
#ifdef _WIN32
- is_drive = is_windows_drive(filename) ||
- is_windows_drive_prefix(filename);
-#else
- is_drive = 0;
+ if (is_windows_drive(filename) ||
+ is_windows_drive_prefix(filename))
+ return bdrv_find_format("file");
#endif
+
p = strchr(filename, ':');
- if (!p || is_drive) {
- drv1 = find_hdev_driver(filename);
- if (!drv1) {
- drv1 = bdrv_find_format("file");
- }
- return drv1;
+ if (!p) {
+ return bdrv_find_format("file");
}
len = p - filename;
if (len > sizeof(protocol) - 1)
next reply other threads:[~2010-06-23 10:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-23 10:25 Christoph Hellwig [this message]
2010-06-23 11:01 ` [Qemu-devel] [PATCH] block: allow filenames with colons again for host devices 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=20100623102517.GA11292@lst.de \
--to=hch@lst.de \
--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).