summaryrefslogtreecommitdiffstats
path: root/discover/discover-server.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-10-24 14:43:05 +0800
committerJeremy Kerr <jk@ozlabs.org>2013-11-13 17:28:18 +0800
commit52bec18801b226b57f53d9f075addd2c07caa3db (patch)
tree73f23d4eb9a812768710a75100607739074d6527 /discover/discover-server.c
parent7832d10c59cfe7f06e19bc6f0b6acaac1a552618 (diff)
downloadtalos-petitboot-52bec18801b226b57f53d9f075addd2c07caa3db.tar.gz
talos-petitboot-52bec18801b226b57f53d9f075addd2c07caa3db.zip
discover: Handle incoming configuration messages
When the client sends us a PB_PROTOCOL_ACTION_CONFIG message, we want to update the current config. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover/discover-server.c')
-rw-r--r--discover/discover-server.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/discover/discover-server.c b/discover/discover-server.c
index bd631f6..3cf9fac 100644
--- a/discover/discover-server.c
+++ b/discover/discover-server.c
@@ -214,6 +214,7 @@ static int discover_server_process_message(void *arg)
struct pb_protocol_message *message;
struct boot_command *boot_command;
struct client *client = arg;
+ struct config *config;
int rc;
message = pb_protocol_read_message(client, client->fd);
@@ -243,6 +244,19 @@ static int discover_server_process_message(void *arg)
device_handler_cancel_default(client->server->device_handler);
break;
+ case PB_PROTOCOL_ACTION_CONFIG:
+ config = talloc_zero(client, struct config);
+
+ rc = pb_protocol_deserialise_config(config, message);
+ if (rc) {
+ pb_log("%s: no config?", __func__);
+ return 0;
+ }
+
+ device_handler_update_config(client->server->device_handler,
+ config);
+ break;
+
default:
pb_log("%s: invalid action %d\n", __func__, message->action);
return 0;
OpenPOWER on IntegriCloud