From aa530148044a7c6d7ec7b6a32672cc69d53979b2 Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Thu, 30 Jan 2014 16:19:20 +0800 Subject: 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 --- lib/types/types.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/types') 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; }; -- cgit v1.2.1