+static void boot_status(void *arg, struct boot_status *status)
+{
+ struct device_handler *handler = arg;
+
+ discover_server_notify_boot_status(handler->server, status);
+}
+
+static int default_timeout(void *arg)
+{
+ struct device_handler *handler = arg;
+
+ if (!handler->default_boot_option)
+ return 0;
+
+ boot(handler, handler->default_boot_option, NULL,
+ handler->dry_run, boot_status, handler);
+ return 0;
+}
+
+static void set_default(struct device_handler *handler,
+ struct discover_boot_option *opt)
+{
+ if (handler->default_boot_option)
+ return;
+
+ handler->default_boot_option = opt;
+ handler->timeout_waiter = waiter_register_timeout(handler->waitset,
+ DEFAULT_BOOT_TIMEOUT_SEC * 1000,
+ default_timeout, handler);
+}
+