path: root/discover/platform.c
diff options
authorJeremy Kerr <>2014-01-30 16:19:20 +0800
committerJeremy Kerr <>2014-01-30 21:59:10 +0800
commitaa530148044a7c6d7ec7b6a32672cc69d53979b2 (patch)
tree09e9ef7bb4a1f0c6976657c581553bb00ea5c40f /discover/platform.c
parenta984595cfb4910ba6f464c69c316f1613f10f894 (diff)
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 <>
Diffstat (limited to 'discover/platform.c')
1 files changed, 2 insertions, 1 deletions
diff --git a/discover/platform.c b/discover/platform.c
index d52c9f6..db0ea61 100644
--- a/discover/platform.c
+++ b/discover/platform.c
@@ -67,8 +67,9 @@ void config_set_defaults(struct config *config)
config->boot_priorities = talloc_array(config, struct boot_priority,
config->boot_priorities[0].type = DEVICE_TYPE_NETWORK;
+ config->boot_priorities[0].priority = 2;
config->boot_priorities[1].type = DEVICE_TYPE_DISK;
+ config->boot_priorities[1].priority = 1;
int platform_init(void *ctx)
OpenPOWER on IntegriCloud