X-Git-Url: https://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=discover%2Fdevice-handler.c;h=3cf7edff082d9f6f880ccdd19c18fa698490cbce;hp=a73a7ce590abe65c7463899f369d7d3c7b549195;hb=d94bb8c48f42678a5f1cf0041429b82aa1938540;hpb=78819395e5aa0dbd0c484f7a2512fcf04b87bbf2 diff --git a/discover/device-handler.c b/discover/device-handler.c index a73a7ce..3cf7edf 100644 --- a/discover/device-handler.c +++ b/discover/device-handler.c @@ -351,6 +351,15 @@ void device_handler_reinit(struct device_handler *handler) unsigned int i; device_handler_cancel_default(handler); + /* Cancel any pending non-default boot */ + if (handler->pending_boot) { + boot_cancel(handler->pending_boot); + handler->pending_boot = NULL; + handler->pending_boot_is_default = false; + } + + /* Cancel any remaining async jobs */ + process_stop_async_all(); /* free unresolved boot options */ list_for_each_entry_safe(&handler->unresolved_boot_options, @@ -442,6 +451,7 @@ static void _device_handler_vstatus(struct device_handler *handler, status.type = type; status.message = talloc_vasprintf(handler, fmt, ap); + status.backlog = false; device_handler_status(handler, &status); @@ -617,6 +627,7 @@ static void countdown_status(struct device_handler *handler, status.type = STATUS_INFO; status.message = talloc_asprintf(handler, _("Booting in %d sec: %s"), sec, opt->option->name); + status.backlog = false; device_handler_status(handler, &status); @@ -1037,8 +1048,6 @@ int device_handler_discover(struct device_handler *handler, _("Processing new %s device"), device_type_display_name(dev->device->type)); - process_boot_option_queue(handler); - /* create our context */ ctx = device_handler_discover_context_create(handler, dev); @@ -1056,6 +1065,7 @@ int device_handler_discover(struct device_handler *handler, /* add discovered stuff to the handler */ device_handler_discover_context_commit(handler, ctx); + process_boot_option_queue(handler); out: talloc_unlink(handler, ctx);