diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2013-03-06 17:08:05 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2013-04-15 15:42:27 +0800 |
commit | ceefe00bf8c1498dfc2118d2b3666f67f91bb956 (patch) | |
tree | 698eda969d88563e4851fc3a96a99b0d3d9936ce /discover/discover-server.c | |
parent | a2f7b111a2073a4afaf75499ac4c2732b71ea801 (diff) | |
download | talos-petitboot-ceefe00bf8c1498dfc2118d2b3666f67f91bb956.tar.gz talos-petitboot-ceefe00bf8c1498dfc2118d2b3666f67f91bb956.zip |
discover: parse boot message from incoming ACTION_BOOT messages
Add a function in the protocol code to deserialise a boot message, and
use it to extract a boot_command in the discover server.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover/discover-server.c')
-rw-r--r-- | discover/discover-server.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/discover/discover-server.c b/discover/discover-server.c index 7633134..76d03d1 100644 --- a/discover/discover-server.c +++ b/discover/discover-server.c @@ -130,6 +130,7 @@ static int write_remove_message(struct discover_server *server, static int discover_server_process_message(void *arg) { struct pb_protocol_message *message; + struct boot_command *boot_command; struct client *client = arg; message = pb_protocol_read_message(client, client->fd); @@ -142,7 +143,14 @@ static int discover_server_process_message(void *arg) return 0; } - /* todo: process boot message */ + boot_command = pb_protocol_deserialise_boot_command(client, message); + if (!boot_command) { + pb_log("%s: no boot command?", __func__); + return 0; + } + + /* todo: pass boot_command to client->server->device_handler */ + return 0; } |