Commit 3c5c4801 authored by Vikas Chaudhary's avatar Vikas Chaudhary Committed by James Bottomley

[SCSI] libiscsi: Added support to show targetalias in sysfs

sysfs patch to view target alias:
  /sys/class/iscsi_session/session*/targetalias
Signed-off-by: default avatarVikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: default avatarMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 331954cf
...@@ -2807,6 +2807,7 @@ void iscsi_session_teardown(struct iscsi_cls_session *cls_session) ...@@ -2807,6 +2807,7 @@ void iscsi_session_teardown(struct iscsi_cls_session *cls_session)
kfree(session->username); kfree(session->username);
kfree(session->username_in); kfree(session->username_in);
kfree(session->targetname); kfree(session->targetname);
kfree(session->targetalias);
kfree(session->initiatorname); kfree(session->initiatorname);
kfree(session->ifacename); kfree(session->ifacename);
...@@ -3233,6 +3234,8 @@ int iscsi_set_param(struct iscsi_cls_conn *cls_conn, ...@@ -3233,6 +3234,8 @@ int iscsi_set_param(struct iscsi_cls_conn *cls_conn,
return iscsi_switch_str_param(&session->password_in, buf); return iscsi_switch_str_param(&session->password_in, buf);
case ISCSI_PARAM_TARGET_NAME: case ISCSI_PARAM_TARGET_NAME:
return iscsi_switch_str_param(&session->targetname, buf); return iscsi_switch_str_param(&session->targetname, buf);
case ISCSI_PARAM_TARGET_ALIAS:
return iscsi_switch_str_param(&session->targetalias, buf);
case ISCSI_PARAM_TPGT: case ISCSI_PARAM_TPGT:
sscanf(buf, "%d", &session->tpgt); sscanf(buf, "%d", &session->tpgt);
break; break;
...@@ -3299,6 +3302,9 @@ int iscsi_session_get_param(struct iscsi_cls_session *cls_session, ...@@ -3299,6 +3302,9 @@ int iscsi_session_get_param(struct iscsi_cls_session *cls_session,
case ISCSI_PARAM_TARGET_NAME: case ISCSI_PARAM_TARGET_NAME:
len = sprintf(buf, "%s\n", session->targetname); len = sprintf(buf, "%s\n", session->targetname);
break; break;
case ISCSI_PARAM_TARGET_ALIAS:
len = sprintf(buf, "%s\n", session->targetalias);
break;
case ISCSI_PARAM_TPGT: case ISCSI_PARAM_TPGT:
len = sprintf(buf, "%d\n", session->tpgt); len = sprintf(buf, "%d\n", session->tpgt);
break; break;
......
...@@ -284,6 +284,7 @@ struct iscsi_session { ...@@ -284,6 +284,7 @@ struct iscsi_session {
char *password; char *password;
char *password_in; char *password_in;
char *targetname; char *targetname;
char *targetalias;
char *ifacename; char *ifacename;
char *initiatorname; char *initiatorname;
/* control data */ /* control data */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment