From: Vikas Chaudhary <vikas.chaudh...@qlogic.com> Signed-off-by: Vikas Chaudhary <vikas.chaudh...@qlogic.com> Signed-off-by: Adheer Chandravanshi <adheer.chandravan...@qlogic.com> --- usr/session_info.c | 24 +++++++++++++++++++----- 1 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/usr/session_info.c b/usr/session_info.c index 1f84c49..c2ea429 100644 --- a/usr/session_info.c +++ b/usr/session_info.c @@ -64,20 +64,32 @@ void session_info_free_list(struct list_head *list) } } +static char *get_iscsi_node_type(struct session_info *info) +{ + int pid = iscsi_sysfs_session_user_created(info->sid); + + if (!pid) + return "flash"; + else + return "non-flash"; +} + static int session_info_print_flat(void *data, struct session_info *info) { struct iscsi_transport *t = iscsi_sysfs_get_transport_by_sid(info->sid); if (strchr(info->persistent_address, '.')) - printf("%s: [%d] %s:%d,%d %s\n", + printf("%s: [%d] %s:%d,%d %s (%s)\n", t ? t->name : UNKNOWN_VALUE, info->sid, info->persistent_address, - info->persistent_port, info->tpgt, info->targetname); + info->persistent_port, info->tpgt, info->targetname, + get_iscsi_node_type(info)); else - printf("%s: [%d] [%s]:%d,%d %s\n", + printf("%s: [%d] [%s]:%d,%d %s (%s)\n", t ? t->name : UNKNOWN_VALUE, info->sid, info->persistent_address, - info->persistent_port, info->tpgt, info->targetname); + info->persistent_port, info->tpgt, info->targetname, + get_iscsi_node_type(info)); return 0; } @@ -230,7 +242,8 @@ void session_info_print_tree(struct list_head *list, char *prefix, list_for_each_entry(curr, list, list) { if (!prev || strcmp(prev->targetname, curr->targetname)) { - printf("%sTarget: %s\n", prefix, curr->targetname); + printf("%sTarget: %s (%s)\n", prefix, curr->targetname, + get_iscsi_node_type(curr)); prev = NULL; } @@ -278,6 +291,7 @@ void session_info_print_tree(struct list_head *list, char *prefix, printf("%s\t\tSID: %d\n", prefix, curr->sid); print_iscsi_state(curr->sid, prefix); } + if (flags & SESSION_INFO_ISCSI_TIM) { printf("%s\t\t*********\n", prefix); printf("%s\t\tTimeouts:\n", prefix); -- 1.7.1 -- You received this message because you are subscribed to the Google Groups "open-iscsi" group. To unsubscribe from this group and stop receiving emails from it, send an email to open-iscsi+unsubscr...@googlegroups.com. To post to this group, send email to open-iscsi@googlegroups.com. Visit this group at http://groups.google.com/group/open-iscsi. For more options, visit https://groups.google.com/groups/opt_out.