Jack Z wrote: > Hi all, > > I'm a CS student and I'm trying to understand and locate the source > code for iSCSI connection establishment. But I encountered the > following problem. Could anyone maybe show me where I should go? Any > help would be highly appreciated!! > > 1. I searched in the entire open-iscsi project and added a "fprintf > (stderr, "Msg No.%d", msg_num);" after each connect() all. But after I > made the project and made install, I still couldn't see any of the > messages from fprintf when I tried to "iscsiadm -m discovery -t st -p > <portal>" or "iscsiadm -m node -T <TargetName> -p <portal> -- > login"... > > 2. Since the first method failed, I tried to trace the source code > nearby the login messages "Logging in to [iface:" and "Login to > [iface: .... successful" and I ended up with the function > > "static int __login_portals(void *data, int *nr_found, > struct list_head *rec_list, > int (* login_fn)(void *, struct list_head *, > struct node_rec *))" > > Is this the function that establishes the connection for login? >
No. It just sends a request to iscsid to connect to the target. Look at iscsi_io_tcp_connect in io.c. It is non blocking so also see iscsi_io_tcp_poll. When that returns that we have connected then we start the iscsi login process. Note that iscsi_io_tcp_connect and iscsi_io_tcp_poll are called through the session->t->template->ep_connect or ep_poll calls. -- You received this message because you are subscribed to the Google Groups "open-iscsi" group. To post to this group, send email to open-is...@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.