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>
return device_lookup_by_name(handler, devstr);
}
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);
struct discover_device *dev, const char *path)
{
char *resolved_path = join_paths(res, dev->mount_path, path);
/* we've been passed a file:// URL, which has no device
* specifier. We can resolve against the original
* device */
/* 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);
}
url->path);
talloc_free(url);
}
/* if there was no device specified, we can resolve now */
if (!pos) {
/* 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);
- resolve_devpath_against_device(res, dev, info->path);
+ resolve_resource_against_device(res, dev, info->path);
talloc_free(info);
return true;
talloc_free(info);
return true;
+void resolve_resource_against_device(struct resource *res,
+ struct discover_device *dev, const char *path);
+
/**
* devpath resources.
*
/**
* devpath resources.
*
bool resolve_devpath_resource(struct device_handler *dev,
struct resource *res);
bool resolve_devpath_resource(struct device_handler *dev,
struct resource *res);