mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-17 04:36:22 +00:00
iscsi-scst: Add mechanism to restore target parameter to default
Writing the string :default: to the /sys entry will restore local_def
This commit is contained in:
committed by
Gleb Chesnokov
parent
12f9b6e681
commit
6a21f456f7
@@ -279,7 +279,10 @@ int params_val_to_str(const struct iscsi_key *keys, int idx, unsigned int val,
|
||||
int params_str_to_val(const struct iscsi_key *keys, int idx, const char *str,
|
||||
unsigned int *val)
|
||||
{
|
||||
if (keys[idx].ops->str_to_val)
|
||||
if (!strcmp(":default:", str)) {
|
||||
*val = keys[idx].local_def;
|
||||
return 0;
|
||||
} else if (keys[idx].ops->str_to_val)
|
||||
return keys[idx].ops->str_to_val(str, val);
|
||||
else
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user