summaryrefslogtreecommitdiffstats
path: root/discover/device-handler.h
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-03-11 17:08:57 +0800
committerJeremy Kerr <jk@ozlabs.org>2013-04-16 12:57:15 +0800
commit92806cf6bc15f680f75879288df12ea9a87e4608 (patch)
tree4a6650d8881dda3c6ee321d1e3350edc646c4baf /discover/device-handler.h
parent7b396a45d43cc464539cc25799ddda3a27339bd8 (diff)
downloadtalos-petitboot-92806cf6bc15f680f75879288df12ea9a87e4608.tar.gz
talos-petitboot-92806cf6bc15f680f75879288df12ea9a87e4608.zip
discover: Separate temporary and permanent device data
At present, we keep both permanent (eg links/n_links) and temporary (event) data in struct discover_context. This change makes discover_context a temporary structure, just used during actual device discovery. Once discovery is complete, the permanent data (discover_device) is "committed" to the device handler. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover/device-handler.h')
-rw-r--r--discover/device-handler.h28
1 files changed, 19 insertions, 9 deletions
diff --git a/discover/device-handler.h b/discover/device-handler.h
index 4cf7d7d..809f88e 100644
--- a/discover/device-handler.h
+++ b/discover/device-handler.h
@@ -4,21 +4,27 @@
#include <list/list.h>
struct device_handler;
+struct discover_device;
struct discover_server;
+struct boot_option;
struct boot_command;
struct event;
struct device;
+struct discover_device {
+ struct device *device;
+
+ char **links;
+ int n_links;
+
+ char *mount_path;
+ char *device_path;
+};
+
struct discover_context {
- char *id;
- char *device_path;
- char *mount_path;
- struct event *event;
- struct device *device;
- char **links;
- int n_links;
-
- struct list_item list;
+ struct event *event;
+ struct discover_device *device;
+ struct list boot_options;
};
struct device_handler *device_handler_init(struct discover_server *server,
@@ -30,6 +36,10 @@ int device_handler_get_device_count(const struct device_handler *handler);
const struct device *device_handler_get_device(
const struct device_handler *handler, unsigned int index);
+struct device *discover_context_device(struct discover_context *ctx);
+void discover_context_add_boot_option(struct discover_context *ctx,
+ struct boot_option *opt);
+
int device_handler_event(struct device_handler *handler, struct event *event);
void device_handler_boot(struct device_handler *handler,
OpenPOWER on IntegriCloud