zdev: Introduce read-only attributes

Add support for defining read-only attributes in the chzdev/lszdev
tools. These attributes can be used to provide online documentation
for specific attributes via the --help-attribute and --list-attributes
tool functions.

Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Reviewed-by: Jens Remus <jremus@linux.ibm.com>
Reviewed-by: Fedor Loshakov <loshakov@linux.ibm.com>
Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Peter Oberparleiter
2019-02-05 15:51:26 +01:00
committed by Jan Höppner
parent d2f8f972cf
commit c063273b14
4 changed files with 23 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
/*
* zdev - Modify and display the persistent configuration of devices
*
* Copyright IBM Corp. 2016, 2017
* Copyright IBM Corp. 2016, 2019
*
* s390-tools is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.
@@ -181,6 +181,7 @@ struct value_map {
* @activeonly: This attribute should only be changed in the active config
* @unstable: The value read is not the last value written
* @writeonly: This attribute cannot be read from
* @readonly: This attribute cannot be written to
* @rewrite: Writing the same value multiple times has side-effects
* @mandatory: This attribute cannot be removed from a configured device
* @newline: There must be a newline when writing to this attribute
@@ -211,6 +212,7 @@ struct attrib {
unsigned int activeonly :1;
unsigned int unstable :1;
unsigned int writeonly :1;
unsigned int readonly :1;
unsigned int rewrite :1;
unsigned int mandatory :1;
unsigned int newline :1;