diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2013-04-16 15:54:13 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2013-04-29 14:31:20 +1000 |
commit | c6a36fdf2fc2e7a1c2bc4c8d16f2a3bb575b5a2f (patch) | |
tree | b91d6c00259e4d2d42d8b217eaae2ef785fcda06 /discover/resource.h | |
parent | d170c0ae55daf41c34497b51a5e84f50b76a42b6 (diff) | |
download | talos-petitboot-c6a36fdf2fc2e7a1c2bc4c8d16f2a3bb575b5a2f.tar.gz talos-petitboot-c6a36fdf2fc2e7a1c2bc4c8d16f2a3bb575b5a2f.zip |
discover: Add devpath resources
Add a generic resource type, to handle "dev:path"-style file references.
This creates a duplicate of is_prefix_ignorecase, which we'll switch
over to later.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover/resource.h')
-rw-r--r-- | discover/resource.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/discover/resource.h b/discover/resource.h index b7e1a46..2debe3c 100644 --- a/discover/resource.h +++ b/discover/resource.h @@ -19,5 +19,29 @@ struct resource { }; }; +/** + * devpath resources. + * + * Most resources in config files will be in one of the following formats: + * - URLs + * - device-local filenames (ie, filenames on the currently-discovered dev) + * - other-device filenames (which speficy the device by a string format, + * using a dev:path format). + * + * The following definitions are a generic resource handler for these types + * of resources. By creating resources with create_devpath_resource, + * parsers can use resolve_devpath_resource as their resolve_resouce + * callback. + */ + +struct resource *create_devpath_resource(void *ctx, + struct discover_device *orig_device, + const char *devpath); + +bool resolve_devpath_resource(struct device_handler *dev, + struct resource *res); + + + #endif /* RESOURCE_H */ |