Re: [PATCH v2] iscsiadm : make iface.ipaddress optional in iface configs for transports that don't have a hard requirement on it.

2014-07-31 Thread Mike Christie
On 07/25/2014 02:42 PM, Anish Bhatt wrote:
> v2: cxgb4i changed to NOT_REQ as set ipaddress is not supported
> Signed-off-by: Anish Bhatt 
> ---
>  usr/initiator_common.c | 15 ---
>  usr/transport.c|  8 
>  usr/transport.h|  6 ++
>  3 files changed, 22 insertions(+), 7 deletions(-)
> 
> diff --git a/usr/initiator_common.c b/usr/initiator_common.c
> index 50f8d41..8ff993d 100644
> --- a/usr/initiator_common.c
> +++ b/usr/initiator_common.c
> @@ -685,9 +685,18 @@ int iscsi_host_set_net_params(struct iface_rec *iface,
>  
>   /* if we need to set the ip addr then set all the iface net settings */
>   if (!iface_is_bound_by_ipaddr(iface)) {
> - log_warning("Please set the iface.ipaddress for iface %s, "
> - "then retry the login command.\n", iface->name);
> - return EINVAL;
> + if (t->template->set_host_ip == SET_HOST_IP_REQ) {
> + log_warning("Please set the iface.ipaddress for iface "
> + "%s, then retry the login command.\n",
> + iface->name);
> + return EINVAL;
> + } else if (t->template->set_host_ip == SET_HOST_IP_OPT) {
> + log_info("Optional iface.ipaddress for iface %s "
> +  "not set.\n", iface->name);
> + return 0;
> + } else {
> + return EINVAL;
> + }
>   }
>  
>   /* these type of drivers need the netdev upd */
> diff --git a/usr/transport.c b/usr/transport.c
> index 2f38519..630f163 100644
> --- a/usr/transport.c
> +++ b/usr/transport.c
> @@ -58,7 +58,7 @@ struct iscsi_transport_template iscsi_iser = {
>  
>  struct iscsi_transport_template cxgb3i = {
>   .name   = "cxgb3i",
> - .set_host_ip= 1,
> + .set_host_ip= SET_HOST_IP_OPT,
>   .ep_connect = ktransport_ep_connect,
>   .ep_poll= ktransport_ep_poll,
>   .ep_disconnect  = ktransport_ep_disconnect,
> @@ -67,7 +67,7 @@ struct iscsi_transport_template cxgb3i = {
>  
>  struct iscsi_transport_template cxgb4i = {
>   .name   = "cxgb4i",
> - .set_host_ip= 1,
> + .set_host_ip= SET_HOST_IP_NOT_REQ,
>   .ep_connect = ktransport_ep_connect,
>   .ep_poll= ktransport_ep_poll,
>   .ep_disconnect  = ktransport_ep_disconnect,
> @@ -76,7 +76,7 @@ struct iscsi_transport_template cxgb4i = {
>  
>  struct iscsi_transport_template bnx2i = {
>   .name   = "bnx2i",
> - .set_host_ip= 1,
> + .set_host_ip= SET_HOST_IP_REQ,
>   .use_boot_info  = 1,
>   .ep_connect = ktransport_ep_connect,
>   .ep_poll= ktransport_ep_poll,
> @@ -94,7 +94,7 @@ struct iscsi_transport_template be2iscsi = {
>  
>  struct iscsi_transport_template qla4xxx = {
>   .name   = "qla4xxx",
> - .set_host_ip= 0,
> + .set_host_ip= SET_HOST_IP_NOT_REQ,
>   .ep_connect = ktransport_ep_connect,
>   .ep_poll= ktransport_ep_poll,
>   .ep_disconnect  = ktransport_ep_disconnect,
> diff --git a/usr/transport.h b/usr/transport.h
> index 388e4b1..73041fa 100644
> --- a/usr/transport.h
> +++ b/usr/transport.h
> @@ -20,6 +20,12 @@
>  #include "types.h"
>  #include "config.h"
>  
> +enum set_host_ip_opts {
> + SET_HOST_IP_NOT_REQ,/* iface.ipaddress is not supported */
> + SET_HOST_IP_REQ,/* iface.ipaddress must be specified*/
> + SET_HOST_IP_OPT,/* iface.ipaddress is not required  */
> +};
> +
>  struct iscsi_transport;
>  struct iscsi_conn;
>  
> 

Merged in commit 96eaaacaeac39625508e6ec8022bb5e565c36a7c

-- 
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/d/optout.


RE: [PATCH v2] iscsiadm : make iface.ipaddress optional in iface configs for transports that don't have a hard requirement on it.

2014-07-25 Thread Anish Bhatt
Yes

> -Original Message-
> From: Michael Christie [mailto:micha...@cs.wisc.edu]
> Sent: Friday, July 25, 2014 2:10 PM
> To: open-iscsi@googlegroups.com
> Cc: Karen Xie; Anish Bhatt
> Subject: Re: [PATCH v2] iscsiadm : make iface.ipaddress optional in iface
> configs for transports that don't have a hard requirement on it.
> 
> Patch looks ok. Will merge when I get can boot up my other box.
> 
> Are you going to send a fix up patch for cxgbi_get_host_param later?
> 
> 
> On Jul 25, 2014, at 2:42 PM, Anish Bhatt  wrote:
> 
> > v2: cxgb4i changed to NOT_REQ as set ipaddress is not supported
> > Signed-off-by: Anish Bhatt 
> > ---
> > usr/initiator_common.c | 15 ---
> > usr/transport.c|  8 
> > usr/transport.h|  6 ++
> > 3 files changed, 22 insertions(+), 7 deletions(-)
> >
> > diff --git a/usr/initiator_common.c b/usr/initiator_common.c index
> > 50f8d41..8ff993d 100644
> > --- a/usr/initiator_common.c
> > +++ b/usr/initiator_common.c
> > @@ -685,9 +685,18 @@ int iscsi_host_set_net_params(struct iface_rec
> > *iface,
> >
> > /* if we need to set the ip addr then set all the iface net settings */
> > if (!iface_is_bound_by_ipaddr(iface)) {
> > -   log_warning("Please set the iface.ipaddress for iface %s, "
> > -   "then retry the login command.\n", iface->name);
> > -   return EINVAL;
> > +   if (t->template->set_host_ip == SET_HOST_IP_REQ) {
> > +   log_warning("Please set the iface.ipaddress for iface
> "
> > +   "%s, then retry the login command.\n",
> > +   iface->name);
> > +   return EINVAL;
> > +   } else if (t->template->set_host_ip == SET_HOST_IP_OPT) {
> > +   log_info("Optional iface.ipaddress for iface %s "
> > +"not set.\n", iface->name);
> > +   return 0;
> > +   } else {
> > +   return EINVAL;
> > +   }
> > }
> >
> > /* these type of drivers need the netdev upd */ diff --git
> > a/usr/transport.c b/usr/transport.c index 2f38519..630f163 100644
> > --- a/usr/transport.c
> > +++ b/usr/transport.c
> > @@ -58,7 +58,7 @@ struct iscsi_transport_template iscsi_iser = {
> >
> > struct iscsi_transport_template cxgb3i = {
> > .name   = "cxgb3i",
> > -   .set_host_ip= 1,
> > +   .set_host_ip= SET_HOST_IP_OPT,
> > .ep_connect = ktransport_ep_connect,
> > .ep_poll= ktransport_ep_poll,
> > .ep_disconnect  = ktransport_ep_disconnect,
> > @@ -67,7 +67,7 @@ struct iscsi_transport_template cxgb3i = {
> >
> > struct iscsi_transport_template cxgb4i = {
> > .name   = "cxgb4i",
> > -   .set_host_ip= 1,
> > +   .set_host_ip= SET_HOST_IP_NOT_REQ,
> > .ep_connect = ktransport_ep_connect,
> > .ep_poll= ktransport_ep_poll,
> > .ep_disconnect  = ktransport_ep_disconnect,
> > @@ -76,7 +76,7 @@ struct iscsi_transport_template cxgb4i = {
> >
> > struct iscsi_transport_template bnx2i = {
> > .name   = "bnx2i",
> > -   .set_host_ip= 1,
> > +   .set_host_ip= SET_HOST_IP_REQ,
> > .use_boot_info  = 1,
> > .ep_connect = ktransport_ep_connect,
> > .ep_poll= ktransport_ep_poll,
> > @@ -94,7 +94,7 @@ struct iscsi_transport_template be2iscsi = {
> >
> > struct iscsi_transport_template qla4xxx = {
> > .name   = "qla4xxx",
> > -   .set_host_ip= 0,
> > +   .set_host_ip= SET_HOST_IP_NOT_REQ,
> > .ep_connect = ktransport_ep_connect,
> > .ep_poll= ktransport_ep_poll,
> > .ep_disconnect  = ktransport_ep_disconnect,
> > diff --git a/usr/transport.h b/usr/transport.h index 388e4b1..73041fa
> > 100644
> > --- a/usr/transport.h
> > +++ b/usr/transport.h
> > @@ -20,6 +20,12 @@
> > #include "types.h"
> > #include "config.h"
> >
> > +enum set_host_ip_opts {
> > +   SET_HOST_IP_NOT_REQ,/* iface.ipaddress is not supported
>   */
> > +   SET_HOST_IP_REQ,/* iface.ipaddress must be specified*/
> > +   SET_HOST_IP_OPT,/* iface.ipaddress is not required  */
> > +};
> > +
> > struct iscsi_transport;
> > struct iscsi_conn;
> >
> 

Re: [PATCH v2] iscsiadm : make iface.ipaddress optional in iface configs for transports that don't have a hard requirement on it.

2014-07-25 Thread Michael Christie
Patch looks ok. Will merge when I get can boot up my other box.

Are you going to send a fix up patch for cxgbi_get_host_param later?


On Jul 25, 2014, at 2:42 PM, Anish Bhatt  wrote:

> v2: cxgb4i changed to NOT_REQ as set ipaddress is not supported
> Signed-off-by: Anish Bhatt 
> ---
> usr/initiator_common.c | 15 ---
> usr/transport.c|  8 
> usr/transport.h|  6 ++
> 3 files changed, 22 insertions(+), 7 deletions(-)
> 
> diff --git a/usr/initiator_common.c b/usr/initiator_common.c
> index 50f8d41..8ff993d 100644
> --- a/usr/initiator_common.c
> +++ b/usr/initiator_common.c
> @@ -685,9 +685,18 @@ int iscsi_host_set_net_params(struct iface_rec *iface,
> 
>   /* if we need to set the ip addr then set all the iface net settings */
>   if (!iface_is_bound_by_ipaddr(iface)) {
> - log_warning("Please set the iface.ipaddress for iface %s, "
> - "then retry the login command.\n", iface->name);
> - return EINVAL;
> + if (t->template->set_host_ip == SET_HOST_IP_REQ) {
> + log_warning("Please set the iface.ipaddress for iface "
> + "%s, then retry the login command.\n",
> + iface->name);
> + return EINVAL;
> + } else if (t->template->set_host_ip == SET_HOST_IP_OPT) {
> + log_info("Optional iface.ipaddress for iface %s "
> +  "not set.\n", iface->name);
> + return 0;
> + } else {
> + return EINVAL;
> + }
>   }
> 
>   /* these type of drivers need the netdev upd */
> diff --git a/usr/transport.c b/usr/transport.c
> index 2f38519..630f163 100644
> --- a/usr/transport.c
> +++ b/usr/transport.c
> @@ -58,7 +58,7 @@ struct iscsi_transport_template iscsi_iser = {
> 
> struct iscsi_transport_template cxgb3i = {
>   .name   = "cxgb3i",
> - .set_host_ip= 1,
> + .set_host_ip= SET_HOST_IP_OPT,
>   .ep_connect = ktransport_ep_connect,
>   .ep_poll= ktransport_ep_poll,
>   .ep_disconnect  = ktransport_ep_disconnect,
> @@ -67,7 +67,7 @@ struct iscsi_transport_template cxgb3i = {
> 
> struct iscsi_transport_template cxgb4i = {
>   .name   = "cxgb4i",
> - .set_host_ip= 1,
> + .set_host_ip= SET_HOST_IP_NOT_REQ,
>   .ep_connect = ktransport_ep_connect,
>   .ep_poll= ktransport_ep_poll,
>   .ep_disconnect  = ktransport_ep_disconnect,
> @@ -76,7 +76,7 @@ struct iscsi_transport_template cxgb4i = {
> 
> struct iscsi_transport_template bnx2i = {
>   .name   = "bnx2i",
> - .set_host_ip= 1,
> + .set_host_ip= SET_HOST_IP_REQ,
>   .use_boot_info  = 1,
>   .ep_connect = ktransport_ep_connect,
>   .ep_poll= ktransport_ep_poll,
> @@ -94,7 +94,7 @@ struct iscsi_transport_template be2iscsi = {
> 
> struct iscsi_transport_template qla4xxx = {
>   .name   = "qla4xxx",
> - .set_host_ip= 0,
> + .set_host_ip= SET_HOST_IP_NOT_REQ,
>   .ep_connect = ktransport_ep_connect,
>   .ep_poll= ktransport_ep_poll,
>   .ep_disconnect  = ktransport_ep_disconnect,
> diff --git a/usr/transport.h b/usr/transport.h
> index 388e4b1..73041fa 100644
> --- a/usr/transport.h
> +++ b/usr/transport.h
> @@ -20,6 +20,12 @@
> #include "types.h"
> #include "config.h"
> 
> +enum set_host_ip_opts {
> + SET_HOST_IP_NOT_REQ,/* iface.ipaddress is not supported */
> + SET_HOST_IP_REQ,/* iface.ipaddress must be specified*/
> + SET_HOST_IP_OPT,/* iface.ipaddress is not required  */
> +};
> +
> struct iscsi_transport;
> struct iscsi_conn;
> 
> -- 
> 2.0.3
> 
> -- 
> 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/d/optout.

-- 
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/d/optout.