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);
/* 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);
}
/* 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;
}
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;
struct resource *res;
res = talloc(opt, struct resource);
+ talloc_steal(res, url);
res->url = url;
res->resolved = true;