zdev: implement option to identify files created by zdev

Enhance the 'chzdev' tool by introducing a new option to discern
files created by 'zdev-tools.' The command usage is as follows:

$ chzdev --is-owner <file-name>

When executed, the command will return an exit code of 0 for all
files generated by zdev-tools. In the case of an unknown file, the
tool will return the exit code 'EXIT_UNKNOWN_FILE i.e 33.'

Signed-off-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Vineeth Vijayan
2024-02-01 16:27:41 +01:00
committed by Jan Höppner
parent 4c2bfb1d47
commit f1f80a8a20
5 changed files with 88 additions and 0 deletions

View File

@@ -54,6 +54,9 @@ typedef enum {
EXIT_GROUP_FAILED = 31, /* CCW group device grouping failed */
EXIT_UNGROUP_FAILED = 32, /* CCW group device ungrouping failed */
/* is-owner related */
EXIT_UNKNOWN_FILE = 33, /* The file is not generated by chzdev */
EXIT_INTERNAL_ERROR = 99, /* An internal error occurred */
} exit_code_t;