Przeglądaj źródła

[settings] Clarify usage of the term "named setting"

There are currently two conflicting usages of the term "named setting"
within iPXE: one refers to predefined settings (such as show up in the
"config" UI), the other refers to settings identified by a name (such
as "net0.dhcp/ip").

Split these usages into the term "predefined setting" and "named
setting" to avoid ambiguity.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 11 lat temu
rodzic
commit
063645118c

+ 3
- 4
src/arch/i386/interface/vmware/guestinfo.c Wyświetl plik

@@ -58,7 +58,7 @@ static int guestinfo_fetch_type ( struct settings *settings,
58 58
 		      strlen ( parent_name ) + 1 /* "." */ +
59 59
 		      strlen ( setting->name ) + 1 /* "." */ +
60 60
 		      ( type ? strlen ( type->name ) : 0 ) + 1 /* NUL */ ];
61
-	struct setting *named_setting;
61
+	struct setting *predefined;
62 62
 	char *info;
63 63
 	int info_len;
64 64
 	int check_len;
@@ -82,9 +82,8 @@ static int guestinfo_fetch_type ( struct settings *settings,
82 82
 
83 83
 	/* Determine default type if necessary */
84 84
 	if ( ! type ) {
85
-		named_setting = find_setting ( setting->name );
86
-		type = ( named_setting ?
87
-			 named_setting->type : &setting_type_string );
85
+		predefined = find_setting ( setting->name );
86
+		type = ( predefined ? predefined->type : &setting_type_string );
88 87
 	}
89 88
 	assert ( type != NULL );
90 89
 

+ 10
- 10
src/core/settings.c Wyświetl plik

@@ -262,7 +262,7 @@ static void autovivified_settings_free ( struct refcnt *refcnt ) {
262 262
 }
263 263
 
264 264
 /**
265
- * Find child named settings block
265
+ * Find child settings block
266 266
  *
267 267
  * @v parent		Parent settings block
268 268
  * @v name		Name within this parent
@@ -289,7 +289,7 @@ struct settings * find_child_settings ( struct settings *parent,
289 289
 }
290 290
 
291 291
 /**
292
- * Find or create child named settings block
292
+ * Find or create child settings block
293 293
  *
294 294
  * @v parent		Parent settings block
295 295
  * @v name		Name within this parent
@@ -383,7 +383,7 @@ parse_settings_name ( const char *name,
383 383
 }
384 384
 
385 385
 /**
386
- * Find named settings block
386
+ * Find settings block
387 387
  *
388 388
  * @v name		Name
389 389
  * @ret settings	Settings block, or NULL
@@ -1113,10 +1113,10 @@ int storef_setting ( struct settings *settings, struct setting *setting,
1113 1113
  */
1114 1114
 
1115 1115
 /**
1116
- * Find named setting
1116
+ * Find predefined setting
1117 1117
  *
1118 1118
  * @v name		Name
1119
- * @ret setting		Named setting, or NULL
1119
+ * @ret setting		Setting, or NULL
1120 1120
  */
1121 1121
 struct setting * find_setting ( const char *name ) {
1122 1122
 	struct setting *setting;
@@ -1192,7 +1192,7 @@ parse_setting_name ( const char *name,
1192 1192
 	char *settings_name;
1193 1193
 	char *setting_name;
1194 1194
 	char *type_name;
1195
-	struct setting *named_setting;
1195
+	struct setting *predefined;
1196 1196
 
1197 1197
 	/* Set defaults */
1198 1198
 	*settings = &settings_root;
@@ -1226,10 +1226,10 @@ parse_setting_name ( const char *name,
1226 1226
 	setting->tag = parse_setting_tag ( setting_name );
1227 1227
 	setting->scope = (*settings)->default_scope;
1228 1228
 	setting->name = setting_name;
1229
-	for_each_table_entry ( named_setting, SETTINGS ) {
1230
-		/* Matches a defined named setting; use that setting */
1231
-		if ( setting_cmp ( named_setting, setting ) == 0 ) {
1232
-			memcpy ( setting, named_setting, sizeof ( *setting ) );
1229
+	for_each_table_entry ( predefined, SETTINGS ) {
1230
+		/* Matches a predefined setting; use that setting */
1231
+		if ( setting_cmp ( predefined, setting ) == 0 ) {
1232
+			memcpy ( setting, predefined, sizeof ( *setting ) );
1233 1233
 			break;
1234 1234
 		}
1235 1235
 	}

+ 2
- 2
src/interface/smbios/smbios_settings.c Wyświetl plik

@@ -197,8 +197,8 @@ struct setting uuid_setting __setting ( SETTING_HOST ) = {
197 197
 	.scope = &smbios_settings_scope,
198 198
 };
199 199
 
200
-/** Other SMBIOS named settings */
201
-struct setting smbios_named_settings[] __setting ( SETTING_HOST_EXTRA ) = {
200
+/** Other SMBIOS predefined settings */
201
+struct setting smbios_predefined_settings[] __setting ( SETTING_HOST_EXTRA ) = {
202 202
 	{
203 203
 		.name = "manufacturer",
204 204
 		.description = "Manufacturer",

+ 1
- 1
src/net/netdev_settings.c Wyświetl plik

@@ -35,7 +35,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
35 35
  *
36 36
  */
37 37
 
38
-/** Network device named settings */
38
+/** Network device predefined settings */
39 39
 struct setting mac_setting __setting ( SETTING_NETDEV ) = {
40 40
 	.name = "mac",
41 41
 	.description = "MAC address",

Ładowanie…
Anuluj
Zapisz