Hi Mike/all,

I am working on a part of user space 1 of TODO list, which precisely says-

the functions that were run (FUNCTION)
the iSCSI packets that were sent/receieved (PDUS)
print out extended iscsi login error information (LOGIN_ERRS)

i) I have written log_debug to retrieve all functions names and print PDUS
sent/recieved.

but in case of FUNCTION for retrieving description I got two ways-
(Please suggest which one is better approach)

(all pls note that description always has to be in format just above
function definition starts-
/**
 * function name - function description
)

1st approach-
 For getting description I will call a function,
       func_descrip(descrip, __FILE__ , __FUNCTION__, __LINE__);
 by this function I will fopen the file and then search for the
desired function name whos one line back i will find /*,
 so that I will be sure this is the description of the desired function :) .

2nd approach is-
 I can create a global structure which will carry the function and
its description, I mean something like:-
 struct func_name_descip{
                           char func_name[20];
                           char func_descrip[256];
                                    };
 and while executing discovery a function which will parse all .c files
under "usr" directory and fill up this structure,
 while calling log_debug for FUNCTION, I will retrieve all values from the
global object of this structure.

disadvantage of 1st approach is- "its very time consuming task for
iscsiadm"
 every time log_debug() is encountered then whole file is parsed for
retrieving description which has been already parsed for other functions.

Whereas disadv of 2nd one is - creating a global variable, also triggering
it during discovery might slow up discovery too (but we can
 trigger it only when user specifies -d FUNCTION).

I think second one is better. Please let me know anyone has a better idea,
also share your views on these two.

ii) Regarding LOGIN_ERRS,
after reading __check_iscsi_status_class(), I thought maybe it should come
in debug with iscsid, I mean
iscsid -f -d LOGIN_ERR
and NOT iscsiadm -m node -T iqn.iet.target -p 102.2.2.2 -d LOGIN_ERR

In TODO, do you also mean't to say same as above I have written.
well I can try to do it for any/both :) , let me know which one is
desired/better.

Thanks,
Rahul.

On Mon, Aug 8, 2011 at 9:49 PM, Mike Christie <micha...@cs.wisc.edu> wrote:

> On 08/03/2011 12:24 PM, rahul gupta wrote:
> > For integers, like timeout:-
> > while fetching from sysfs_get_str(), I am setting timeouts to -1 for
> > indicating error and also in qla card's case where chap is not supported
> in
> > /sys,
> > and then while printing, checking same value by taking its complement.
> >
> > I found in iscsid.conf file setting timeout value to -1 to huge -ve value
> is
> > valid (as after setting that can restart iscsid successfully) but not
> really
> > sure does user uses it.
> > I assume user never uses -1 for timeout in iscsid.conf file, so I have
> used
> > it in following code for error purpose:-
> >
> > Signed-off-by: Rahul Gupta <rahulrgupt...@gmail.com>
> >
> > iSCSI user space TODO item-2 : Displaying timeout and CHAP.
> >
> > Date: Wed Aug 3 22:35:30 2011 IST.
> >
>
> Thank you for your work on this. Merged in commit
> 42a5950919038cac331c7fa69304478bd62bec15. It should show up on
> kernel.org in a couple hours.
>

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-iscsi@googlegroups.com.
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.

Reply via email to