diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2013-05-08 16:39:58 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2013-05-16 11:56:28 +0800 |
commit | ca4dc846bddf8feaafacbdb9c6ebb086a9d99723 (patch) | |
tree | 26be94928e14652bcc85ee4411de70c36e7002c0 /discover/resource.c | |
parent | a5db3ced87f5f24500f785b70af8b8630bc1c077 (diff) | |
download | talos-petitboot-ca4dc846bddf8feaafacbdb9c6ebb086a9d99723.tar.gz talos-petitboot-ca4dc846bddf8feaafacbdb9c6ebb086a9d99723.zip |
discover/resource: Provide resolve_resource_against_device
Any other implementation of resources will need to resolve againsst
particular devices, so make resolve_devpath_against_device
publically-accessible, and rename to not be devpath-specific.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover/resource.c')
-rw-r--r-- | discover/resource.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/discover/resource.c b/discover/resource.c index b4fa9ca..25fff65 100644 --- a/discover/resource.c +++ b/discover/resource.c @@ -34,7 +34,8 @@ static struct discover_device *parse_device_string( return device_lookup_by_name(handler, devstr); } -static void resolve_devpath_against_device(struct resource *res, + +void resolve_resource_against_device(struct resource *res, struct discover_device *dev, const char *path) { char *resolved_path = join_paths(res, dev->mount_path, path); @@ -67,7 +68,7 @@ struct resource *create_devpath_resource(struct discover_boot_option *opt, /* we've been passed a file:// URL, which has no device * specifier. We can resolve against the original * device */ - resolve_devpath_against_device(res, orig_device, + resolve_resource_against_device(res, orig_device, url->path); talloc_free(url); } @@ -76,7 +77,7 @@ struct resource *create_devpath_resource(struct discover_boot_option *opt, /* if there was no device specified, we can resolve now */ if (!pos) { - resolve_devpath_against_device(res, orig_device, devpath); + resolve_resource_against_device(res, orig_device, devpath); return res; } @@ -109,7 +110,7 @@ bool resolve_devpath_resource(struct device_handler *handler, if (!dev) return false; - resolve_devpath_against_device(res, dev, info->path); + resolve_resource_against_device(res, dev, info->path); talloc_free(info); return true; |