Yangkook Kim wrote:>
> int iscsid_req_by_rec(iscsiadm_cmd_e cmd, node_rec_t *rec)
> {
>       int err, fd;
> 
>       err = iscsid_req_by_rec_async(cmd, rec, &fd);
>       if (err)
>               return err;


If the iscsid_request call in iscsid_req_by_rec_async failed we would 
return the err value here.  Then in iscsiadm.c we do:

{
......

        rc = iscsid_req_by_rec(MGMT_IPC_SESSION_LOGIN, rec);

In the line above we set rc to the err value returned when 
iscsid_req_by_rec called iscsid_req_by_rec_async and failed.


        /* we raced with another app or instance of iscsiadm */
        if (rc == MGMT_IPC_ERR_EXISTS) {
                if (async_req)
                        free(async_req);
                return 0;
        } else if (rc) {


And then right here we see rc is a error.

                iscsid_handle_error(rc);


Finally here we print out the initiator reported error XYZ here.

                if (async_req)
                        free(async_req);
                return ENOTCONN;
        }
        } else if (rc) {
                iscsid_handle_error(rc);
                if (async_req)
                        free(async_req);
                return ENOTCONN;
.....
}


If the iscsid_req_by_rec call to iscsid_req_by_rec_async is successful 
then we will return the error value of that below. And then again we 
would set rc to that return value and evaluate like it above in the 
iscsiadm.c snippet.

>       return iscsid_req_wait(cmd, fd);
> }
> 


For your #2 issue you are right that is messed up.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to