Skip to content
Permalink
Browse files

iscsiadm : make iface.ipaddress optional in iface configs for transpo…

…rts that don't have a hard requirement on it.

v2: cxgb4i changed to NOT_REQ as set ipaddress is not supported
Signed-off-by: Anish Bhatt <anish@chelsio.com>
  • Loading branch information...
anish authored and Mike Christie committed Jul 25, 2014
1 parent 33cb16e commit 96eaaacaeac39625508e6ec8022bb5e565c36a7c
Showing with 22 additions and 7 deletions.
  1. +12 −3 usr/initiator_common.c
  2. +4 −4 usr/transport.c
  3. +6 −0 usr/transport.h
@@ -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 */
@@ -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,
@@ -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;

0 comments on commit 96eaaac

Please sign in to comment.
You can’t perform that action at this time.