]> git.ozlabs.org Git - petitboot/blobdiff - discover/resource.c
test/parser: Add check_name helper
[petitboot] / discover / resource.c
index 917a6dcbf4f8fdbedff2e544d648978d1ea6b353..b31a215b39be8b345e46abe97fcb1c2ae16387de 100644 (file)
@@ -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, ':');
 
@@ -111,3 +111,15 @@ bool resolve_devpath_resource(struct device_handler *handler,
 
        return true;
 }
+
+struct resource *create_url_resource(struct discover_boot_option *opt,
+               struct pb_url *url)
+{
+       struct resource *res;
+
+       res = talloc(opt, struct resource);
+       res->url = url;
+       res->resolved = true;
+
+       return res;
+}