diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2014-04-02 14:53:07 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2014-04-02 14:53:07 +0800 |
commit | 85bd33ca9777c386359b9b3899888316354a4e1f (patch) | |
tree | 4a0b0b4ba8f7bb3af4b33d9adf15473c63edc248 /ui | |
parent | 310de3ab00b77b09a897b93ed0272b82ebc4f73b (diff) | |
download | petitboot-85bd33ca9777c386359b9b3899888316354a4e1f.zip petitboot-85bd33ca9777c386359b9b3899888316354a4e1f.tar.gz |
protocol: expose discovery reinit over client/server protocol
Now that we can re-initialise the device handler, allow this to be
triggered from UIs over the petitboot protocol.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/common/discover-client.c | 13 | ||||
-rw-r--r-- | ui/common/discover-client.h | 3 |
2 files changed, 16 insertions, 0 deletions
diff --git a/ui/common/discover-client.c b/ui/common/discover-client.c index 0e7da9d..fbf70ba 100644 --- a/ui/common/discover-client.c +++ b/ui/common/discover-client.c @@ -333,6 +333,19 @@ int discover_client_cancel_default(struct discover_client *client) return pb_protocol_write_message(client->fd, message); } +int discover_client_send_reinit(struct discover_client *client) +{ + struct pb_protocol_message *message; + + message = pb_protocol_create_message(client, + PB_PROTOCOL_ACTION_REINIT, 0); + + if (!message) + return -1; + + return pb_protocol_write_message(client->fd, message); +} + int discover_client_send_config(struct discover_client *client, struct config *config) { diff --git a/ui/common/discover-client.h b/ui/common/discover-client.h index 68be8a5..405bd24 100644 --- a/ui/common/discover-client.h +++ b/ui/common/discover-client.h @@ -76,6 +76,9 @@ int discover_client_boot(struct discover_client *client, */ int discover_client_cancel_default(struct discover_client *client); +/* Tell the discover server to reinitialise */ +int discover_client_send_reinit(struct discover_client *client); + /* Send new configuration data to the discover server */ int discover_client_send_config(struct discover_client *client, struct config *config); |