summaryrefslogtreecommitdiffstats
path: root/discover/paths.c
diff options
context:
space:
mode:
authorGeoff Levand <geoffrey.levand@am.sony.com>2009-04-12 15:11:47 +0000
committerJeremy Kerr <jk@ozlabs.org>2009-06-30 15:29:14 +0800
commitdc13479d33efc6cf4b55bfd7b4875c44e4a9bbd0 (patch)
tree0da6caa807e61d1f6cb51b2b3fcb5103bcd7c875 /discover/paths.c
parent1eaa67c4bd124bd9e786c64c95f4fb1f3570482b (diff)
downloadtalos-petitboot-dc13479d33efc6cf4b55bfd7b4875c44e4a9bbd0.tar.gz
talos-petitboot-dc13479d33efc6cf4b55bfd7b4875c44e4a9bbd0.zip
Add URL test to resolve_path
Add a check to discover's resolve_path() to test if the path is a URL, and if so just return that path. If the path has "file://", treat it as a local path. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover/paths.c')
-rw-r--r--discover/paths.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/discover/paths.c b/discover/paths.c
index 5b550fa..8e2a361 100644
--- a/discover/paths.c
+++ b/discover/paths.c
@@ -116,9 +116,17 @@ const char *mountpoint_for_device(const char *dev)
char *resolve_path(void *alloc_ctx, const char *path, const char *current_dev)
{
+ static const char s_file[] = "file://";
char *ret;
const char *devpath, *sep;
+ /* test for urls */
+
+ if (!strncasecmp(path, s_file, sizeof(s_file) - 1))
+ path += sizeof(s_file) - 1;
+ else if (strstr(path, "://"))
+ return talloc_strdup(alloc_ctx, path);
+
sep = strchr(path, ':');
if (!sep) {
devpath = mountpoint_for_device(current_dev);
OpenPOWER on IntegriCloud