X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=discover%2Fdiscover-server.c;h=34d82be828cc623bb7e5f12b949a72c23953c052;hp=814053dc02106a544fadba561a54c9f615101efd;hb=3917e88b838001b13a19fc6ea01d08b08c0770ca;hpb=fbe876dd19e4c289ba940b2e7f0ae0b23b790025 diff --git a/discover/discover-server.c b/discover/discover-server.c index 814053d..34d82be 100644 --- a/discover/discover-server.c +++ b/discover/discover-server.c @@ -247,6 +247,7 @@ static int write_config_message(struct discover_server *server, static int discover_server_process_message(void *arg) { + struct autoboot_option *autoboot_opt; struct pb_protocol_message *message; struct boot_command *boot_command; struct client *client = arg; @@ -269,7 +270,7 @@ static int discover_server_process_message(void *arg) rc = pb_protocol_deserialise_boot_command(boot_command, message); if (rc) { - pb_log("%s: no boot command?", __func__); + pb_log_fn("no boot command?\n"); return 0; } @@ -290,7 +291,7 @@ static int discover_server_process_message(void *arg) rc = pb_protocol_deserialise_config(config, message); if (rc) { - pb_log("%s: no config?", __func__); + pb_log_fn("no config?\n"); return 0; } @@ -311,8 +312,23 @@ static int discover_server_process_message(void *arg) device_handler_install_plugin(client->server->device_handler, url); break; + + case PB_PROTOCOL_ACTION_TEMP_AUTOBOOT: + autoboot_opt = talloc_zero(client, struct autoboot_option); + rc = pb_protocol_deserialise_temp_autoboot(autoboot_opt, + message); + if (rc) { + pb_log("can't parse temporary autoboot message\n"); + return 0; + } + + device_handler_apply_temp_autoboot( + client->server->device_handler, + autoboot_opt); + break; + default: - pb_log("%s: invalid action %d\n", __func__, message->action); + pb_log_fn("invalid action %d\n", message->action); return 0; }