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:
Brian Meagher
2024-04-26 09:38:36 +03:00
committed by Gleb Chesnokov
parent 12f9b6e681
commit 6a21f456f7
+4 -1
View File
@@ -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;