summaryrefslogtreecommitdiffstats
path: root/discover/resource.h
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-03-14 15:55:55 +0800
committerJeremy Kerr <jk@ozlabs.org>2013-04-29 14:31:20 +1000
commitd170c0ae55daf41c34497b51a5e84f50b76a42b6 (patch)
treeab74df0c2d96892e6ad0335e2e996f065adca5a0 /discover/resource.h
parente4f5bd235894c11823ac1befe8c8c43063cad026 (diff)
downloadtalos-petitboot-d170c0ae55daf41c34497b51a5e84f50b76a42b6.tar.gz
talos-petitboot-d170c0ae55daf41c34497b51a5e84f50b76a42b6.zip
discover: Add struct resource
Introduce a new type, struct resource, for handling resources such as kernels and initrds. This allows the parsers to better describe resources that are required for booting. Firstly, we enforce all resources to be URLs, rather than local paths. Also, resources allow us to describe files devices that have not-yet been hotplugged. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover/resource.h')
-rw-r--r--discover/resource.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/discover/resource.h b/discover/resource.h
new file mode 100644
index 0000000..b7e1a46
--- /dev/null
+++ b/discover/resource.h
@@ -0,0 +1,23 @@
+#ifndef RESOURCE_H
+#define RESOURCE_H
+
+#include <stdbool.h>
+
+struct pb_url;
+
+/**
+ * Data for local/remote resources. Resources may be "unresolved", in that
+ * they refer to a device that is not yet present. Unresolved resources
+ * simply contain parser-specific data (generally a device string parsed from
+ * the config file), and may be resolved by the parser once new devices appear.
+ */
+struct resource {
+ bool resolved;
+ union {
+ struct pb_url *url;
+ void *info;
+ };
+};
+
+#endif /* RESOURCE_H */
+
OpenPOWER on IntegriCloud