iscsi: Extract iSCSI subsystem initialization into a function
This patch extracts iSCSI subsystem initialization by .INI config file into a function spdk_iscsi_parse_iscsi_globals(). Naming rule was adopted from NVMf-tgt. By these two patches, iSCSI subsystem init is done in spdk_iscsi_parse_iscsi_globals(). iscsi subsystem config is done in spdk_iscsi_parse_iscsi_configuration(). The purpose of the patch series is - to separate iSCSI subsystem initialization and iSCSI subsystem configuration, and - to develop a new JSON-RPC by reusing the separated iSCSI subsystem initialization. Change-Id: Ibafb0b62cbb0aa23dd6dd6007dad0345293e65b8 Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-on: https://review.gerrithub.io/403146 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
a11b2f3058
commit
1dd0a513a8
@ -935,6 +935,27 @@ end:
|
||||
spdk_iscsi_init_complete(rc);
|
||||
}
|
||||
|
||||
static int
|
||||
spdk_iscsi_parse_iscsi_globals(void)
|
||||
{
|
||||
int rc;
|
||||
|
||||
rc = spdk_iscsi_app_read_parameters();
|
||||
if (rc < 0) {
|
||||
SPDK_ERRLOG("spdk_iscsi_app_read_parameters() failed\n");
|
||||
return rc;
|
||||
}
|
||||
|
||||
rc = spdk_initialize_iscsi_conns();
|
||||
if (rc < 0) {
|
||||
SPDK_ERRLOG("spdk_initialize_iscsi_conns() failed\n");
|
||||
return rc;
|
||||
}
|
||||
|
||||
spdk_initialize_iscsi_poll_group(spdk_iscsi_parse_iscsi_configuration);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
spdk_iscsi_init(spdk_iscsi_init_cb cb_fn, void *cb_arg)
|
||||
{
|
||||
@ -944,21 +965,17 @@ spdk_iscsi_init(spdk_iscsi_init_cb cb_fn, void *cb_arg)
|
||||
g_init_cb_fn = cb_fn;
|
||||
g_init_cb_arg = cb_arg;
|
||||
|
||||
rc = spdk_iscsi_app_read_parameters();
|
||||
rc = spdk_iscsi_parse_iscsi_globals();
|
||||
if (rc < 0) {
|
||||
SPDK_ERRLOG("spdk_iscsi_app_read_parameters() failed\n");
|
||||
SPDK_ERRLOG("spdk_iscsi_parse_globals() failed\n");
|
||||
spdk_iscsi_init_complete(-1);
|
||||
return;
|
||||
}
|
||||
|
||||
rc = spdk_initialize_iscsi_conns();
|
||||
if (rc < 0) {
|
||||
SPDK_ERRLOG("spdk_initialize_iscsi_conns() failed\n");
|
||||
spdk_iscsi_init_complete(-1);
|
||||
return;
|
||||
}
|
||||
|
||||
spdk_initialize_iscsi_poll_group(spdk_iscsi_parse_iscsi_configuration);
|
||||
/*
|
||||
* spdk_iscsi_parse_configuration() will be called as the callback to
|
||||
* spdk_initialize_iscsi_poll_group() and will complete iSCSI
|
||||
* subsystem initialization.
|
||||
*/
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user