summaryrefslogtreecommitdiffstats
path: root/discover/device-handler.h
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-03-14 14:18:54 +0800
committerJeremy Kerr <jk@ozlabs.org>2013-04-29 14:31:20 +1000
commite4f5bd235894c11823ac1befe8c8c43063cad026 (patch)
treec5787f3434f43d331edfb55dc64d1d4dfe1cb807 /discover/device-handler.h
parent397dc244bfdc2a57fc3e8fd191b0ef60c8a4b66b (diff)
downloadtalos-petitboot-e4f5bd235894c11823ac1befe8c8c43063cad026.tar.gz
talos-petitboot-e4f5bd235894c11823ac1befe8c8c43063cad026.zip
discover: Introduce a container type for boot options
This change introduces a new type, struct discover_boot_option. Like struct discover_device adds discover-specific data to struct device, struct discover_boot_option allows the discover server to store more than just the boot option strings for a boot option. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover/device-handler.h')
-rw-r--r--discover/device-handler.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/discover/device-handler.h b/discover/device-handler.h
index 9a7cf6d..3c4574b 100644
--- a/discover/device-handler.h
+++ b/discover/device-handler.h
@@ -22,8 +22,17 @@ struct discover_device {
char *mount_path;
char *device_path;
+
+ struct list boot_options;
+};
+
+struct discover_boot_option {
+ struct discover_device *device;
+ struct boot_option *option;
+ struct list_item list;
};
+
struct discover_context {
struct event *event;
struct discover_device *device;
@@ -36,12 +45,15 @@ struct device_handler *device_handler_init(struct discover_server *server,
void device_handler_destroy(struct device_handler *devices);
int device_handler_get_device_count(const struct device_handler *handler);
-const struct device *device_handler_get_device(
+const struct discover_device *device_handler_get_device(
const struct device_handler *handler, unsigned int index);
struct device *discover_context_device(struct discover_context *ctx);
+struct discover_boot_option *discover_boot_option_create(
+ struct discover_context *ctx,
+ struct discover_device *dev);
void discover_context_add_boot_option(struct discover_context *ctx,
- struct boot_option *opt);
+ struct discover_boot_option *opt);
int device_handler_event(struct device_handler *handler, struct event *event);
OpenPOWER on IntegriCloud