]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[settings] Allow settings blocks to specify a sibling ordering
authorMichael Brown <mcb30@ipxe.org>
Tue, 19 Jul 2016 15:44:18 +0000 (16:44 +0100)
committerMichael Brown <mcb30@ipxe.org>
Tue, 19 Jul 2016 16:07:53 +0000 (17:07 +0100)
Allow settings blocks to provide an explicit default ordering between
siblings, with lower precedence than the existing ${priority} setting.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/core/settings.c
src/include/ipxe/settings.h

index 42bb5e53f88f3fae23a0b6cbd76bba9ab6ad18f3..c306054d690e7f37ecb61fce090ed9f22c67c839 100644 (file)
@@ -452,6 +452,8 @@ static void reprioritise_settings ( struct settings *settings ) {
                tmp_priority = fetch_intz_setting ( tmp, &priority_setting );
                if ( priority > tmp_priority )
                        break;
+               if ( settings->order > tmp->order )
+                       break;
        }
        list_add_tail ( &settings->siblings, &tmp->siblings );
 
index 07ebaa620c7bce53c5a4bbb068849be4052e2a21..8cc0b6bb71385d22f97a36e68952893298e60b21 100644 (file)
@@ -144,6 +144,8 @@ struct settings {
        struct settings_operations *op;
        /** Default scope for numerical settings constructed for this block */
        const struct settings_scope *default_scope;
+       /** Sibling ordering */
+       int order;
 };
 
 /**