zdev: Add option to select IPL device

Add new command-line option --ipldev. When specified and IPL was done
from a supported device type, the IPL device is selected for the
requested tool operation.

Example to list IPL device information:

$ lszdev --ipldev

Example to create a persistent configuration for the IPL device:

$ chzdev --enable --persistent --ipldev

Reviewed-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Peter Oberparleiter
2024-07-04 16:10:17 +02:00
committed by Jan Höppner
parent cad4e9e15b
commit d9a9bd8dcf
14 changed files with 158 additions and 5 deletions

View File

@@ -477,6 +477,26 @@ static void dasd_st_add_modules(struct subtype *st, struct device *dev,
strlist_add_unique(modules, DASD_DIAG_MOD_NAME);
}
static char *dasd_eckd_st_get_ipldev_id(struct subtype *st)
{
char *id, *type;
/* Handle CCW-type IPL first. */
id = st->super->get_ipldev_id(st);
if (id)
return id;
/* Extra-handling for eckd LD-IPL. */
type = path_read_text_file(1, err_ignore, PATH_IPL "/ipl_type");
if (strcmp(type, "eckd") != 0)
goto out;
id = path_read_text_file(1, err_ignore, PATH_IPL "/ipl/device");
out:
free(type);
return id;
}
/*
* DASD methods.
*/
@@ -798,6 +818,7 @@ struct subtype dasd_subtype_eckd = {
.configure_persistent = &dasd_st_configure_persistent,
.check_pre_configure = &dasd_st_check_pre_configure,
.add_modules = &dasd_st_add_modules,
.get_ipldev_id = &dasd_eckd_st_get_ipldev_id,
};
static struct ccw_subtype_data dasd_fba_data = {