resource_is_resolved(opt->icon);
}
-static bool resource_resolve(struct resource *res, struct parser *parser,
+static bool resource_resolve(struct resource *res, const char *name,
+ struct discover_boot_option *opt,
struct device_handler *handler)
{
+ struct parser *parser = opt->source;
+
if (resource_is_resolved(res))
return true;
+ pb_log("Attempting to resolve resource %s->%s with parser %s\n",
+ opt->option->id, name, parser->name);
parser->resolve_resource(handler, res);
return res->resolved;
static bool boot_option_resolve(struct discover_boot_option *opt,
struct device_handler *handler)
{
- return resource_resolve(opt->boot_image, opt->source, handler) &&
- resource_resolve(opt->initrd, opt->source, handler) &&
- resource_resolve(opt->icon, opt->source, handler);
+ return resource_resolve(opt->boot_image, "boot_image", opt, handler) &&
+ resource_resolve(opt->initrd, "initrd", opt, handler) &&
+ resource_resolve(opt->icon, "icon", opt, handler);
}
static void boot_option_finalise(struct discover_boot_option *opt)
list_for_each_entry_safe(&handler->unresolved_boot_options,
opt, tmp, list) {
+ pb_log("queue: attempting resolution for %s\n",
+ opt->option->id);
+
if (!boot_option_resolve(opt, handler))
continue;
+ pb_log("\tresolved!\n");
+
list_remove(&opt->list);
list_add(&opt->device->boot_options, &opt->list);
talloc_steal(opt->device, opt);
/* this new device might be able to resolve existing boot
* options */
+ pb_log("New device %s, processing queue\n", dev->device->id);
process_boot_option_queue(handler);
}
list_remove(&opt->list);
if (boot_option_resolve(opt, handler)) {
+ pb_log("boot option %s is resolved, "
+ "sending to clients\n",
+ opt->option->id);
list_add(&dev->boot_options, &opt->list);
talloc_steal(dev, opt);
boot_option_finalise(opt);