]> git.ozlabs.org Git - petitboot/blobdiff - discover/resource.c
discover: log cleanup
[petitboot] / discover / resource.c
index 964c1a4d40f78b68ff922980a86c930e699cc3db..b4fa9ca3930f350b8622027a793c0a5be427ef55 100644 (file)
@@ -6,6 +6,7 @@
 #include <string.h>
 
 #include <url/url.h>
+#include <log/log.h>
 #include <talloc/talloc.h>
 
 #include "device-handler.h"
@@ -41,7 +42,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 +51,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, ':');
 
@@ -82,6 +83,8 @@ struct resource *create_devpath_resource(void *ctx,
        devstr = talloc_strndup(res, devpath, pos - devpath);
        path = talloc_strdup(res, pos + 1);
 
+       pb_log("%s: resource depends on device %s\n", __func__, devstr);
+
        /* defer resolution until we can find a suitable matching device */
        info = talloc(res, struct devpath_resource_info);
        info->dev = devstr;
@@ -112,11 +115,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;