ui/common: Add code to send cancel-default messages
authorJeremy Kerr <jk@ozlabs.org>
Tue, 21 May 2013 06:20:51 +0000 (14:20 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Mon, 24 Jun 2013 04:52:50 +0000 (12:52 +0800)
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
ui/common/discover-client.c
ui/common/discover-client.h

index 107d0314d2de24f563e6c87bbe0d66ec4f733330..ae5d5cd2e50b00e03cfca47b41fb6b0c8e23d0eb 100644 (file)
@@ -278,3 +278,16 @@ int discover_client_boot(struct discover_client *client,
 
        return rc;
 }
+
+int discover_client_cancel_default(struct discover_client *client)
+{
+       struct pb_protocol_message *message;
+
+       message = pb_protocol_create_message(client,
+                       PB_PROTOCOL_ACTION_CANCEL_DEFAULT, 0);
+
+       if (!message)
+               return -1;
+
+       return pb_protocol_write_message(client->fd, message);
+}
index 2245a65141330883383af48f9e448fa4e4a0e256..83bb9c97ea1de7b6aaa8ab6c4ac096bd029614b2 100644 (file)
@@ -59,4 +59,8 @@ int discover_client_boot(struct discover_client *client,
                const struct device *device,
                const struct boot_option *boot_option,
                const struct pb_boot_data *data);
+
+/* Tell the discover server to cancel the default boot option, if any
+ */
+int discover_client_cancel_default(struct discover_client *client);
 #endif