mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zdev: Do not export inacceptable attribute values
For some device driver SysFS attributes, values read may not be
acceptable input values for that attribute.
An example would be the group of qeth VNICC attributes that return "n/a"
when VNICC setup is not supported, but only accept "0" and "1" as valid
values that can be written to it.
This leads to errors such as the following when data for such attributes
is imported:
# chzdev f500 --import test.conf
Importing configuration data from test.conf
QETH device 0.0.f500:0.0.f501:0.0.f502 configure failed
Error: Invalid value for qeth attribute: vnicc/flooding=n/a (*)
Acceptable values:
- Integers in the range 0 - 1
Use 'chzdev qeth --help-attribute vnicc/flooding' for more information
Note: You can use --force to override safety checks (*)
To fix this, change chzdev's --export function to skip any attribute
value that is not acceptable for that attribute.
Fixes: e831269e74 ("zdev: Add support for VNIC Characteristics")
Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
90dc65659f
commit
4ff6519961
@@ -78,6 +78,10 @@ static bool is_exportable(struct setting *s, config_t config)
|
||||
/* Skip values that cannot be determined. */
|
||||
return false;
|
||||
}
|
||||
if (!attrib_check_value(a, s->value)) {
|
||||
/* Skip values that are not acceptable input values. */
|
||||
return false;
|
||||
}
|
||||
if (!attrib_match_default(s->attrib, s->value)) {
|
||||
/* All non-default values should be exported. */
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user