summaryrefslogtreecommitdiffstats
path: root/lib/types
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2014-01-30 16:19:20 +0800
committerJeremy Kerr <jk@ozlabs.org>2014-01-30 21:59:10 +0800
commitaa530148044a7c6d7ec7b6a32672cc69d53979b2 (patch)
tree09e9ef7bb4a1f0c6976657c581553bb00ea5c40f /lib/types
parenta984595cfb4910ba6f464c69c316f1613f10f894 (diff)
downloadtalos-petitboot-aa530148044a7c6d7ec7b6a32672cc69d53979b2.tar.gz
talos-petitboot-aa530148044a7c6d7ec7b6a32672cc69d53979b2.zip
discover: Make boot_priorities more flexible
Rather than rely on the ordering of the boot_priorities array to define which device types have a higher "default boot" priority, this change introduces a slightly more flexible way of priority lookups, by adding a separate priority field to struct boot_priority. This means we can have an unordered array, change priorities without re-writing the array, and implementing a disable mechanism. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'lib/types')
-rw-r--r--lib/types/types.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/types/types.h b/lib/types/types.h
index 3a76cda..a1065ee 100644
--- a/lib/types/types.h
+++ b/lib/types/types.h
@@ -109,6 +109,11 @@ struct network_config {
};
struct boot_priority {
+ /* Boot options with higher priority values will take precedence over
+ * lower values. Negative priorities signify "don't boot this by
+ * default".
+ */
+ int priority;
enum device_type type;
};
OpenPOWER on IntegriCloud