summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-04-12 16:57:30 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-04-12 18:59:13 +0100
commit4be630edb31f654068509d470e8b44039580954d (patch)
tree7550e1e2bf0a7eca92ce4ccdbc5de430c1177a6d
parent4dba0e1e9d7fca190e7877856ce69618d99e85c9 (diff)
downloadlibguestfs-4be630edb31f654068509d470e8b44039580954d.tar.gz
libguestfs-4be630edb31f654068509d470e8b44039580954d.tar.xz
libguestfs-4be630edb31f654068509d470e8b44039580954d.zip
lib: Remove check_path function, limitation is colon, not comma (RHBZ#811649).
Remove the bogus check_path function and move the functionality into the two places where it was being used. qemu -cdrom , works fine, I tested it. Colon cannot be used in a block device filename anywhere, since the qemu block driver interprets it as a prefix. There is no known way to work around this problem. I checked this is true with kwolf. Comma is fine in -drive options, provided it is escaped by doubling it.
-rw-r--r--src/launch.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/launch.c b/src/launch.c
index 35cf49e3..fe858b8d 100644
--- a/src/launch.c
+++ b/src/launch.c
@@ -277,16 +277,6 @@ valid_format_iface (const char *str)
return 1;
}
-static int
-check_path (guestfs_h *g, const char *filename)
-{
- if (strchr (filename, ',') != NULL) {
- error (g, _("filename cannot contain ',' (comma) character"));
- return -1;
- }
- return 0;
-}
-
int
guestfs__add_drive_opts (guestfs_h *g, const char *filename,
const struct guestfs_add_drive_opts_argv *optargs)
@@ -297,8 +287,11 @@ guestfs__add_drive_opts (guestfs_h *g, const char *filename,
char *name;
int use_cache_off;
- if (check_path(g, filename) == -1)
+ if (strchr (filename, ':') != NULL) {
+ error (g, _("filename cannot contain ':' (colon) character. "
+ "This is a limitation of qemu."));
return -1;
+ }
readonly = optargs->bitmask & GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK
? optargs->readonly : 0;
@@ -406,8 +399,11 @@ guestfs__add_drive_ro_with_if (guestfs_h *g, const char *filename,
int
guestfs__add_cdrom (guestfs_h *g, const char *filename)
{
- if (check_path(g, filename) == -1)
+ if (strchr (filename, ':') != NULL) {
+ error (g, _("filename cannot contain ':' (colon) character. "
+ "This is a limitation of qemu."));
return -1;
+ }
if (access (filename, F_OK) == -1) {
perrorf (g, "%s", filename);