X-Git-Url: https://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=discover%2Fdevice-handler.c;h=9e4c5bb228ebb285b9a905198e69f930e862d8e4;hp=594a7c3c80a87b2c142cd17730cf09f46b50b149;hb=b12d51994790ef2896d99f24b0bfb3e20a4f0912;hpb=19dab336ae13f0476bfbf0db34f1329a802eeb8e diff --git a/discover/device-handler.c b/discover/device-handler.c index 594a7c3..9e4c5bb 100644 --- a/discover/device-handler.c +++ b/discover/device-handler.c @@ -149,8 +149,20 @@ static void context_commit(struct device_handler *handler, discover_server_notify_boot_option_add(handler->server, opt->option); } else { - list_add(&handler->unresolved_boot_options, &opt->list); - talloc_steal(handler, opt); + if (!opt->source->resolve_resource) { + pb_log("parser %s gave us an unresolved " + "resource (%s), but no way to " + "resolve it\n", + opt->source->name, opt->option->id); + talloc_free(opt); + } else { + pb_log("boot option %s is unresolved, " + "adding to queue\n", + opt->option->id); + list_add(&handler->unresolved_boot_options, + &opt->list); + talloc_steal(handler, opt); + } } } } @@ -663,6 +675,13 @@ static struct discover_boot_option *find_boot_option_by_id( return NULL; } +static void boot_status(void *arg, struct boot_status *status) +{ + struct device_handler *handler = arg; + + discover_server_notify_boot_status(handler->server, status); +} + void device_handler_boot(struct device_handler *handler, struct boot_command *cmd) { @@ -670,5 +689,5 @@ void device_handler_boot(struct device_handler *handler, opt = find_boot_option_by_id(handler, cmd->option_id); - boot(handler, opt, cmd, handler->dry_run); + boot(handler, opt, cmd, handler->dry_run, boot_status, handler); }