Skip to content

Commit

Permalink
iscsi-scst: Add mechanism to restore target parameter to default
Browse files Browse the repository at this point in the history
Writing the string :default: to the /sys entry will restore local_def
  • Loading branch information
bmeagherix authored and lnocturno committed Apr 26, 2024
1 parent 12f9b6e commit 6a21f45
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion iscsi-scst/usr/param.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6a21f45

Please sign in to comment.