iscsi: Change type CHAP parameters for discovery from int to bool
Currently CHAP parameters for discovery are handled as bool but they are defined as int. Hence change their type from int to bool as done for target node previously. Change-Id: I1e815946d4bdececcdd7cc873a725afbbcb98e50 Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-on: https://review.gerrithub.io/403234 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
3af8e26df8
commit
ed3e889fcd
@ -269,9 +269,9 @@ struct spdk_iscsi_opts {
|
|||||||
char *nodebase;
|
char *nodebase;
|
||||||
int timeout;
|
int timeout;
|
||||||
int nopininterval;
|
int nopininterval;
|
||||||
int no_discovery_auth;
|
bool no_discovery_auth;
|
||||||
int req_discovery_auth;
|
bool req_discovery_auth;
|
||||||
int req_discovery_auth_mutual;
|
bool req_discovery_auth_mutual;
|
||||||
int discovery_auth_group;
|
int discovery_auth_group;
|
||||||
uint32_t MaxSessions;
|
uint32_t MaxSessions;
|
||||||
uint32_t MaxConnectionsPerSession;
|
uint32_t MaxConnectionsPerSession;
|
||||||
@ -295,9 +295,9 @@ struct spdk_iscsi_globals {
|
|||||||
|
|
||||||
int timeout;
|
int timeout;
|
||||||
int nopininterval;
|
int nopininterval;
|
||||||
int no_discovery_auth;
|
bool no_discovery_auth;
|
||||||
int req_discovery_auth;
|
bool req_discovery_auth;
|
||||||
int req_discovery_auth_mutual;
|
bool req_discovery_auth_mutual;
|
||||||
int discovery_auth_group;
|
int discovery_auth_group;
|
||||||
|
|
||||||
uint32_t MaxSessions;
|
uint32_t MaxSessions;
|
||||||
|
@ -1231,11 +1231,11 @@ spdk_rpc_get_iscsi_global_params(struct spdk_jsonrpc_request *request,
|
|||||||
spdk_json_write_int32(w, g_spdk_iscsi.nopininterval);
|
spdk_json_write_int32(w, g_spdk_iscsi.nopininterval);
|
||||||
|
|
||||||
spdk_json_write_name(w, "discovery_auth_method");
|
spdk_json_write_name(w, "discovery_auth_method");
|
||||||
if (g_spdk_iscsi.no_discovery_auth != 0) {
|
if (g_spdk_iscsi.no_discovery_auth) {
|
||||||
spdk_json_write_string(w, "none");
|
spdk_json_write_string(w, "none");
|
||||||
} else if (g_spdk_iscsi.req_discovery_auth == 0) {
|
} else if (!g_spdk_iscsi.req_discovery_auth) {
|
||||||
spdk_json_write_string(w, "auto");
|
spdk_json_write_string(w, "auto");
|
||||||
} else if (g_spdk_iscsi.req_discovery_auth_mutual != 0) {
|
} else if (g_spdk_iscsi.req_discovery_auth_mutual) {
|
||||||
spdk_json_write_string(w, "chap mutual");
|
spdk_json_write_string(w, "chap mutual");
|
||||||
} else {
|
} else {
|
||||||
spdk_json_write_string(w, "chap");
|
spdk_json_write_string(w, "chap");
|
||||||
|
@ -545,10 +545,10 @@ spdk_iscsi_log_globals(void)
|
|||||||
SPDK_DEBUGLOG(SPDK_LOG_ISCSI, "Timeout %d\n", g_spdk_iscsi.timeout);
|
SPDK_DEBUGLOG(SPDK_LOG_ISCSI, "Timeout %d\n", g_spdk_iscsi.timeout);
|
||||||
SPDK_DEBUGLOG(SPDK_LOG_ISCSI, "NopInInterval %d\n",
|
SPDK_DEBUGLOG(SPDK_LOG_ISCSI, "NopInInterval %d\n",
|
||||||
g_spdk_iscsi.nopininterval);
|
g_spdk_iscsi.nopininterval);
|
||||||
if (g_spdk_iscsi.no_discovery_auth != 0) {
|
if (g_spdk_iscsi.no_discovery_auth) {
|
||||||
SPDK_DEBUGLOG(SPDK_LOG_ISCSI,
|
SPDK_DEBUGLOG(SPDK_LOG_ISCSI,
|
||||||
"DiscoveryAuthMethod None\n");
|
"DiscoveryAuthMethod None\n");
|
||||||
} else if (g_spdk_iscsi.req_discovery_auth == 0) {
|
} else if (!g_spdk_iscsi.req_discovery_auth) {
|
||||||
SPDK_DEBUGLOG(SPDK_LOG_ISCSI,
|
SPDK_DEBUGLOG(SPDK_LOG_ISCSI,
|
||||||
"DiscoveryAuthMethod Auto\n");
|
"DiscoveryAuthMethod Auto\n");
|
||||||
} else {
|
} else {
|
||||||
@ -584,9 +584,9 @@ spdk_iscsi_opts_init(struct spdk_iscsi_opts *opts)
|
|||||||
opts->ErrorRecoveryLevel = DEFAULT_ERRORRECOVERYLEVEL;
|
opts->ErrorRecoveryLevel = DEFAULT_ERRORRECOVERYLEVEL;
|
||||||
opts->timeout = DEFAULT_TIMEOUT;
|
opts->timeout = DEFAULT_TIMEOUT;
|
||||||
opts->nopininterval = DEFAULT_NOPININTERVAL;
|
opts->nopininterval = DEFAULT_NOPININTERVAL;
|
||||||
opts->no_discovery_auth = 0;
|
opts->no_discovery_auth = false;
|
||||||
opts->req_discovery_auth = 0;
|
opts->req_discovery_auth = false;
|
||||||
opts->req_discovery_auth_mutual = 0;
|
opts->req_discovery_auth_mutual = false;
|
||||||
opts->discovery_auth_group = 0;
|
opts->discovery_auth_group = 0;
|
||||||
opts->authfile = strdup(SPDK_ISCSI_DEFAULT_AUTHFILE);
|
opts->authfile = strdup(SPDK_ISCSI_DEFAULT_AUTHFILE);
|
||||||
opts->nodebase = strdup(SPDK_ISCSI_DEFAULT_NODEBASE);
|
opts->nodebase = strdup(SPDK_ISCSI_DEFAULT_NODEBASE);
|
||||||
@ -717,21 +717,21 @@ spdk_iscsi_read_config_file_params(struct spdk_conf_section *sp,
|
|||||||
val = spdk_conf_section_get_val(sp, "DiscoveryAuthMethod");
|
val = spdk_conf_section_get_val(sp, "DiscoveryAuthMethod");
|
||||||
if (val != NULL) {
|
if (val != NULL) {
|
||||||
if (strcasecmp(val, "CHAP") == 0) {
|
if (strcasecmp(val, "CHAP") == 0) {
|
||||||
opts->no_discovery_auth = 0;
|
opts->no_discovery_auth = false;
|
||||||
opts->req_discovery_auth = 1;
|
opts->req_discovery_auth = true;
|
||||||
opts->req_discovery_auth_mutual = 0;
|
opts->req_discovery_auth_mutual = false;
|
||||||
} else if (strcasecmp(val, "Mutual") == 0) {
|
} else if (strcasecmp(val, "Mutual") == 0) {
|
||||||
opts->no_discovery_auth = 0;
|
opts->no_discovery_auth = false;
|
||||||
opts->req_discovery_auth = 1;
|
opts->req_discovery_auth = true;
|
||||||
opts->req_discovery_auth_mutual = 1;
|
opts->req_discovery_auth_mutual = true;
|
||||||
} else if (strcasecmp(val, "Auto") == 0) {
|
} else if (strcasecmp(val, "Auto") == 0) {
|
||||||
opts->no_discovery_auth = 0;
|
opts->no_discovery_auth = false;
|
||||||
opts->req_discovery_auth = 0;
|
opts->req_discovery_auth = false;
|
||||||
opts->req_discovery_auth_mutual = 0;
|
opts->req_discovery_auth_mutual = false;
|
||||||
} else if (strcasecmp(val, "None") == 0) {
|
} else if (strcasecmp(val, "None") == 0) {
|
||||||
opts->no_discovery_auth = 1;
|
opts->no_discovery_auth = true;
|
||||||
opts->req_discovery_auth = 0;
|
opts->req_discovery_auth = false;
|
||||||
opts->req_discovery_auth_mutual = 0;
|
opts->req_discovery_auth_mutual = false;
|
||||||
} else {
|
} else {
|
||||||
SPDK_ERRLOG("unknown auth %s, ignoring\n", val);
|
SPDK_ERRLOG("unknown auth %s, ignoring\n", val);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user