summaryrefslogtreecommitdiffstats
path: root/discover/resource.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-05-13 09:16:00 +0800
committerJeremy Kerr <jk@ozlabs.org>2013-05-15 14:38:04 +0800
commit1b50985db4e85030de3567792aedc13aa26e0fea (patch)
tree48cca47b21140712ca20b5eaff2c4b041fb6ac48 /discover/resource.c
parent07bf13167aacf49a694aea3341caa15379916bec (diff)
downloadtalos-petitboot-1b50985db4e85030de3567792aedc13aa26e0fea.tar.gz
talos-petitboot-1b50985db4e85030de3567792aedc13aa26e0fea.zip
discover: Always associate resources with a boot option
We should always be tallocing resources to a boot option context; anything else (for example, the discover context) may have a different lifetime. In order to enforce this, we change the void *ctx argument to the context_create functions to a struct discover_boot_option. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover/resource.c')
-rw-r--r--discover/resource.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/discover/resource.c b/discover/resource.c
index 964c1a4..b31a215 100644
--- a/discover/resource.c
+++ b/discover/resource.c
@@ -41,7 +41,7 @@ static void resolve_devpath_against_device(struct resource *res,
res->resolved = true;
}
-struct resource *create_devpath_resource(void *ctx,
+struct resource *create_devpath_resource(struct discover_boot_option *opt,
struct discover_device *orig_device,
const char *devpath)
{
@@ -50,7 +50,7 @@ struct resource *create_devpath_resource(void *ctx,
struct resource *res;
struct pb_url *url;
- res = talloc(ctx, struct resource);
+ res = talloc(opt, struct resource);
pos = strchr(devpath, ':');
@@ -112,11 +112,12 @@ bool resolve_devpath_resource(struct device_handler *handler,
return true;
}
-struct resource *create_url_resource(void *ctx, struct pb_url *url)
+struct resource *create_url_resource(struct discover_boot_option *opt,
+ struct pb_url *url)
{
struct resource *res;
- res = talloc(ctx, struct resource);
+ res = talloc(opt, struct resource);
res->url = url;
res->resolved = true;
OpenPOWER on IntegriCloud