Re: [Patch 2/2] iscsiadm: checking return value of iscsid_req_wait() in iscsid_req_by_rec()

2009-11-16 Thread Mike Christie

Yangkook Kim wrote:
 It looks like you used the git tree. What branch did you use? I am
 asking because I could not find the code below.
 
 I actually did't use git. I just used diff -Naur file1 file2  my patch.
 and put signed-off by myself.
 
 This is actually very first time to send patch and dont't know the correct
 manner to send a patch to maintainer. Sorry for making confused you.
 
 Do I have to use git to make patch?
 
 I actually put modified patch of util.c that adds checking
 MGMT_IPC_ERR_EXISTS as
 I explained in the reply to your question in [Pathch 1/2].
 
 If it would be better if making patch using git, I will do so.
 

You do not have to make a patch with git. If you do Erez sent a mail 
with good instructions on how to set things up.

If you just make a patch with diff, let me know what version of 
open-iscsi you are patching against.

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



Re: [Patch 2/2] iscsiadm: checking return value of iscsid_req_wait() in iscsid_req_by_rec()

2009-11-12 Thread Mike Christie

Yangkook Kim wrote:
 This patch adds some codes to output logs to reflect the return value
 of iscsid_req_wait() for outputting logging.
 

Thanks for the patch!

It looks like you used the git tree. What branch did you use? I am 
asking because I could not find the code below.


 int nsec;
 @@ -231,7 +259,18 @@
 err = iscsid_req_by_rec_async(cmd, rec, fd);
 if (err)
 return err;
 -   return iscsid_req_wait(cmd, fd);
 +   err = iscsid_req_wait(cmd, fd);
 +   if (err) {
 +   log_error(Could not login to [iface: %s, target: %s, 
 + portal: %s,%d]: , rec-iface.name,
 +  rec-name, rec-conn[0].address,
 +  rec-conn[0].port);
 +   } else
 +   printf(Login to [iface: %s, target: %s, portal: 
 +  %s,%d]: successful\n, rec-iface.name,
 +   rec-name, rec-conn[0].address,
 +   rec-conn[0].port);
 +   return err;
  }
 
  int iscsid_req_by_sid_async(iscsiadm_cmd_e cmd, int sid, int *fd)
 @@ -312,34 +351,6 @@
 iface_setup_defaults(rec-iface);
  }
 
 -void iscsid_handle_error(mgmt_ipc_err_e err)
 -{
 -   static char *err_msgs[] = {
 -   /* 0 */ ,
 -   /* 1 */ unknown error,
 -   /* 2 */ not found,
 -   /* 3 */ no available memory,
 -   /* 4 */ encountered connection failure,
 -   /* 5 */ encountered iSCSI login failure,
 -   /* 6 */ encountered iSCSI database failure,
 -   /* 7 */ invalid parameter,
 -   /* 8 */ connection timed out,
 -   /* 9 */ internal error,
 -   /* 10 */ encountered iSCSI logout failure,
 -   /* 11 */ iSCSI PDU timed out,
 -   /* 12 */ iSCSI driver not found. Please make sure it
 is loaded, and retry the operation,
 -   /* 13 */ daemon access denied,
 -   /* 14 */ iSCSI driver does not support requested 
 capability.,
 -   /* 15 */ already exists,
 -   /* 16 */ Unknown request,
 -   /* 17 */ encountered iSNS failure,
 -   /* 18 */ could not communicate to iscsid,
 -   /* 19 */ encountered non-retryable iSCSI login failure,
 -   /* 20 */ could not connect to iscsid,
 -   };
 -   log_error(initiator reported error (%d - %s), err, err_msgs[err]);
 -}
 -
  int __iscsi_match_session(node_rec_t *rec, char *targetname,
   char *address, int port, struct iface_rec *iface)
  {
 
  
 


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



[Patch 2/2] iscsiadm: checking return value of iscsid_req_wait() in iscsid_req_by_rec()

2009-11-11 Thread Yangkook Kim
This patch adds some codes to output logs to reflect the return value
of iscsid_req_wait() for outputting logging.

Please give me a feedback if any.

-- Yangkook Kim


Signed-off-by: Yangkook Kim yangkook...@gmail.com

---

--- a/usr/util.c2009-11-12 06:22:10.0 +0900
+++ b/usr/util.c2009-11-12 06:28:45.0 +0900
@@ -121,6 +121,34 @@

 #define MAXSLEEP 128

+void iscsid_handle_error(mgmt_ipc_err_e err)
+{
+   static char *err_msgs[] = {
+   /* 0 */ ,
+   /* 1 */ unknown error,
+   /* 2 */ not found,
+   /* 3 */ no available memory,
+   /* 4 */ encountered connection failure,
+   /* 5 */ encountered iSCSI login failure,
+   /* 6 */ encountered iSCSI database failure,
+   /* 7 */ invalid parameter,
+   /* 8 */ connection timed out,
+   /* 9 */ internal error,
+   /* 10 */ encountered iSCSI logout failure,
+   /* 11 */ iSCSI PDU timed out,
+   /* 12 */ iSCSI driver not found. Please make sure it
is loaded, and retry the operation,
+   /* 13 */ daemon access denied,
+   /* 14 */ iSCSI driver does not support requested capability.,
+   /* 15 */ already exists,
+   /* 16 */ Unknown request,
+   /* 17 */ encountered iSNS failure,
+   /* 18 */ could not communicate to iscsid,
+   /* 19 */ encountered non-retryable iSCSI login failure,
+   /* 20 */ could not connect to iscsid,
+   };
+   log_error(initiator reported error (%d - %s), err, err_msgs[err]);
+}
+
 static mgmt_ipc_err_e iscsid_connect(int *fd)
 {
int nsec;
@@ -231,7 +259,18 @@
err = iscsid_req_by_rec_async(cmd, rec, fd);
if (err)
return err;
-   return iscsid_req_wait(cmd, fd);
+   err = iscsid_req_wait(cmd, fd);
+   if (err) {
+   log_error(Could not login to [iface: %s, target: %s, 
+ portal: %s,%d]: , rec-iface.name,
+  rec-name, rec-conn[0].address,
+  rec-conn[0].port);
+   } else
+   printf(Login to [iface: %s, target: %s, portal: 
+  %s,%d]: successful\n, rec-iface.name,
+   rec-name, rec-conn[0].address,
+   rec-conn[0].port);
+   return err;
 }

 int iscsid_req_by_sid_async(iscsiadm_cmd_e cmd, int sid, int *fd)
@@ -312,34 +351,6 @@
iface_setup_defaults(rec-iface);
 }

-void iscsid_handle_error(mgmt_ipc_err_e err)
-{
-   static char *err_msgs[] = {
-   /* 0 */ ,
-   /* 1 */ unknown error,
-   /* 2 */ not found,
-   /* 3 */ no available memory,
-   /* 4 */ encountered connection failure,
-   /* 5 */ encountered iSCSI login failure,
-   /* 6 */ encountered iSCSI database failure,
-   /* 7 */ invalid parameter,
-   /* 8 */ connection timed out,
-   /* 9 */ internal error,
-   /* 10 */ encountered iSCSI logout failure,
-   /* 11 */ iSCSI PDU timed out,
-   /* 12 */ iSCSI driver not found. Please make sure it
is loaded, and retry the operation,
-   /* 13 */ daemon access denied,
-   /* 14 */ iSCSI driver does not support requested capability.,
-   /* 15 */ already exists,
-   /* 16 */ Unknown request,
-   /* 17 */ encountered iSNS failure,
-   /* 18 */ could not communicate to iscsid,
-   /* 19 */ encountered non-retryable iSCSI login failure,
-   /* 20 */ could not connect to iscsid,
-   };
-   log_error(initiator reported error (%d - %s), err, err_msgs[err]);
-}
-
 int __iscsi_match_session(node_rec_t *rec, char *targetname,
  char *address, int port, struct iface_rec *iface)
 {

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

--- a/usr/util.c	2009-11-12 06:22:10.0 +0900
+++ b/usr/util.c	2009-11-12 06:28:45.0 +0900
@@ -121,6 +121,34 @@
 
 #define MAXSLEEP 128
 
+void iscsid_handle_error(mgmt_ipc_err_e err)
+{
+	static char *err_msgs[] = {
+		/* 0 */ ,
+		/* 1 */ unknown error,
+		/* 2 */ not found,
+		/* 3 */ no available memory,
+		/* 4 */ encountered connection failure,
+		/* 5 */ encountered iSCSI login failure,
+		/* 6 */ encountered iSCSI database failure,
+		/* 7 */ invalid parameter,
+		/* 8 */ connection timed out,
+		/* 9 */ internal error,
+		/* 10 */ encountered iSCSI logout