[settings] Allow for autovivification of settings blocks

Allow for settings blocks to be created on demand.  This allows for
constructions such as

  set defaults/filename http://bootserver/bootfile
  set defaults/priority 0xff
  dhcp net0
  chain ${filename}

which will boot from the DHCP-provided filename, or from
"http://bootserver/bootfile" if the DHCP server does not provide a
filename.

(Note that "priority" gets interpreted as a signed integer, so setting
"defaults/priority" to 0xff will cause the "defaults" settings block
to have an effective priority of -1.)
This commit is contained in:
Michael Brown
2009-03-06 14:40:44 +00:00
parent f95c919741
commit ec24672db7
2 changed files with 113 additions and 53 deletions

View File

@@ -193,8 +193,6 @@ extern int fetch_uuid_setting ( struct settings *settings,
struct setting *setting, union uuid *uuid );
extern int setting_cmp ( struct setting *a, struct setting *b );
extern struct settings * find_child_settings ( struct settings *parent,
const char *name );
extern struct settings * find_settings ( const char *name );
extern int storef_setting ( struct settings *settings,