scsi: Move event subsystem initialization to event_scsi
This removes the event framework dependency from the scsi library entirely. Change-Id: I73546d06721487f86c4c6a3be24474a5677bdb41 Signed-off-by: Ben Walker <benjamin.walker@intel.com> Reviewed-on: https://review.gerrithub.io/365728 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
0c25463da0
commit
c9f8765a69
@ -42,7 +42,6 @@
|
|||||||
#include "spdk/stdinc.h"
|
#include "spdk/stdinc.h"
|
||||||
|
|
||||||
#include "spdk/queue.h"
|
#include "spdk/queue.h"
|
||||||
#include "spdk/event.h"
|
|
||||||
|
|
||||||
/* Defines for SPDK tracing framework */
|
/* Defines for SPDK tracing framework */
|
||||||
#define OWNER_SCSI_DEV 0x10
|
#define OWNER_SCSI_DEV 0x10
|
||||||
@ -159,9 +158,9 @@ struct spdk_scsi_dev;
|
|||||||
*/
|
*/
|
||||||
struct spdk_scsi_lun;
|
struct spdk_scsi_lun;
|
||||||
|
|
||||||
void spdk_scsi_subsystem_init(void);
|
int spdk_scsi_init(void);
|
||||||
|
|
||||||
int spdk_scsi_subsystem_fini(void);
|
int spdk_scsi_fini(void);
|
||||||
|
|
||||||
int spdk_scsi_lun_get_id(const struct spdk_scsi_lun *lun);
|
int spdk_scsi_lun_get_id(const struct spdk_scsi_lun *lun);
|
||||||
const char *spdk_scsi_lun_get_name(const struct spdk_scsi_lun *lun);
|
const char *spdk_scsi_lun_get_name(const struct spdk_scsi_lun *lun);
|
||||||
|
@ -37,5 +37,21 @@
|
|||||||
|
|
||||||
#include "spdk_internal/event.h"
|
#include "spdk_internal/event.h"
|
||||||
|
|
||||||
|
static void
|
||||||
|
spdk_scsi_subsystem_init(void)
|
||||||
|
{
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
rc = spdk_scsi_init();
|
||||||
|
|
||||||
|
spdk_subsystem_init_next(rc);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
spdk_scsi_subsystem_fini(void)
|
||||||
|
{
|
||||||
|
return spdk_scsi_fini();
|
||||||
|
}
|
||||||
|
|
||||||
SPDK_SUBSYSTEM_REGISTER(scsi, spdk_scsi_subsystem_init, spdk_scsi_subsystem_fini, NULL)
|
SPDK_SUBSYSTEM_REGISTER(scsi, spdk_scsi_subsystem_init, spdk_scsi_subsystem_fini, NULL)
|
||||||
SPDK_SUBSYSTEM_DEPEND(scsi, bdev)
|
SPDK_SUBSYSTEM_DEPEND(scsi, bdev)
|
||||||
|
@ -36,8 +36,6 @@
|
|||||||
|
|
||||||
#include "spdk/conf.h"
|
#include "spdk/conf.h"
|
||||||
|
|
||||||
#include "spdk_internal/event.h"
|
|
||||||
|
|
||||||
#define DEFAULT_MAX_UNMAP_LBA_COUNT 4194304
|
#define DEFAULT_MAX_UNMAP_LBA_COUNT 4194304
|
||||||
#define DEFAULT_MAX_UNMAP_BLOCK_DESCRIPTOR_COUNT 1
|
#define DEFAULT_MAX_UNMAP_BLOCK_DESCRIPTOR_COUNT 1
|
||||||
#define DEFAULT_OPTIMAL_UNMAP_GRANULARITY 0
|
#define DEFAULT_OPTIMAL_UNMAP_GRANULARITY 0
|
||||||
@ -97,29 +95,28 @@ spdk_read_config_scsi_parameters(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
int
|
||||||
spdk_scsi_subsystem_init(void)
|
spdk_scsi_init(void)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc;
|
||||||
|
|
||||||
rc = pthread_mutex_init(&g_spdk_scsi.mutex, NULL);
|
rc = pthread_mutex_init(&g_spdk_scsi.mutex, NULL);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
SPDK_ERRLOG("mutex_init() failed\n");
|
SPDK_ERRLOG("mutex_init() failed\n");
|
||||||
goto end;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = spdk_read_config_scsi_parameters();
|
rc = spdk_read_config_scsi_parameters();
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
SPDK_ERRLOG("spdk_scsi_parameters() failed\n");
|
SPDK_ERRLOG("spdk_scsi_parameters() failed\n");
|
||||||
rc = -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
end:
|
return 0;
|
||||||
spdk_subsystem_init_next(rc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
spdk_scsi_subsystem_fini(void)
|
spdk_scsi_fini(void)
|
||||||
{
|
{
|
||||||
pthread_mutex_destroy(&g_spdk_scsi.mutex);
|
pthread_mutex_destroy(&g_spdk_scsi.mutex);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -33,18 +33,12 @@
|
|||||||
|
|
||||||
#include "spdk/stdinc.h"
|
#include "spdk/stdinc.h"
|
||||||
|
|
||||||
#include "spdk/event.h"
|
|
||||||
#include "spdk/scsi.h"
|
#include "spdk/scsi.h"
|
||||||
|
|
||||||
#include "spdk_cunit.h"
|
#include "spdk_cunit.h"
|
||||||
|
|
||||||
#include "scsi.c"
|
#include "scsi.c"
|
||||||
|
|
||||||
/* Unit test stubbed bdev subsystem dependency */
|
|
||||||
SPDK_SUBSYSTEM_REGISTER(bdev, NULL, NULL, NULL)
|
|
||||||
|
|
||||||
static int global_rc;
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
null_init(void)
|
null_init(void)
|
||||||
{
|
{
|
||||||
@ -57,22 +51,6 @@ null_clean(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
spdk_add_subsystem(struct spdk_subsystem *subsystem)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
spdk_add_subsystem_depend(struct spdk_subsystem_depend *depend)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
spdk_subsystem_init_next(int rc)
|
|
||||||
{
|
|
||||||
global_rc = rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct spdk_conf *
|
static struct spdk_conf *
|
||||||
spdk_config_init_scsi_params(char *key, char *value)
|
spdk_config_init_scsi_params(char *key, char *value)
|
||||||
{
|
{
|
||||||
@ -122,17 +100,17 @@ static void
|
|||||||
scsi_init_sp_null(void)
|
scsi_init_sp_null(void)
|
||||||
{
|
{
|
||||||
struct spdk_conf *config;
|
struct spdk_conf *config;
|
||||||
|
int rc;
|
||||||
|
|
||||||
config = spdk_conf_allocate();
|
config = spdk_conf_allocate();
|
||||||
SPDK_CU_ASSERT_FATAL(config != NULL);
|
SPDK_CU_ASSERT_FATAL(config != NULL);
|
||||||
|
|
||||||
spdk_conf_set_as_default(config);
|
spdk_conf_set_as_default(config);
|
||||||
|
|
||||||
global_rc = -1;
|
rc = spdk_scsi_init();
|
||||||
spdk_scsi_subsystem_init();
|
|
||||||
|
|
||||||
/* sp = null; set default scsi params */
|
/* sp = null; set default scsi params */
|
||||||
CU_ASSERT_EQUAL(global_rc, 0);
|
CU_ASSERT_EQUAL(rc, 0);
|
||||||
|
|
||||||
spdk_conf_set_as_default(NULL);
|
spdk_conf_set_as_default(NULL);
|
||||||
|
|
||||||
@ -144,19 +122,19 @@ scsi_init_set_max_unmap_lba_count_config_param(void)
|
|||||||
{
|
{
|
||||||
struct spdk_scsi_parameters params;
|
struct spdk_scsi_parameters params;
|
||||||
struct spdk_conf *config;
|
struct spdk_conf *config;
|
||||||
|
int rc;
|
||||||
|
|
||||||
/* set scsi_params.max_unmap_lba_count = 65536 of Scsi section */
|
/* set scsi_params.max_unmap_lba_count = 65536 of Scsi section */
|
||||||
config = spdk_config_init_scsi_params("MaxUnmapLbaCount", "65536");
|
config = spdk_config_init_scsi_params("MaxUnmapLbaCount", "65536");
|
||||||
spdk_conf_set_as_default(config);
|
spdk_conf_set_as_default(config);
|
||||||
global_rc = -1;
|
rc = spdk_scsi_init();
|
||||||
spdk_scsi_subsystem_init();
|
CU_ASSERT_EQUAL(rc, 0);
|
||||||
|
|
||||||
/* Assert the scsi_params.max_unmap_lba_count == 65536 and
|
/* Assert the scsi_params.max_unmap_lba_count == 65536 and
|
||||||
* assert the rest of the params are set to their default values */
|
* assert the rest of the params are set to their default values */
|
||||||
set_default_scsi_params(¶ms);
|
set_default_scsi_params(¶ms);
|
||||||
params.max_unmap_lba_count = 65536;
|
params.max_unmap_lba_count = 65536;
|
||||||
CU_ASSERT(memcmp(&g_spdk_scsi.scsi_params, ¶ms, sizeof(params)) == 0);
|
CU_ASSERT(memcmp(&g_spdk_scsi.scsi_params, ¶ms, sizeof(params)) == 0);
|
||||||
CU_ASSERT_EQUAL(global_rc, 0);
|
|
||||||
|
|
||||||
spdk_conf_free(config);
|
spdk_conf_free(config);
|
||||||
}
|
}
|
||||||
@ -166,20 +144,20 @@ scsi_init_set_max_unmap_block_descriptor_count_config_param(void)
|
|||||||
{
|
{
|
||||||
struct spdk_scsi_parameters params;
|
struct spdk_scsi_parameters params;
|
||||||
struct spdk_conf *config;
|
struct spdk_conf *config;
|
||||||
|
int rc;
|
||||||
|
|
||||||
/* set scsi_params.max_unmap_block_descriptor_count = 1
|
/* set scsi_params.max_unmap_block_descriptor_count = 1
|
||||||
* of Scsi section */
|
* of Scsi section */
|
||||||
config = spdk_config_init_scsi_params("MaxUnmapBlockDescriptorCount", "1");
|
config = spdk_config_init_scsi_params("MaxUnmapBlockDescriptorCount", "1");
|
||||||
spdk_conf_set_as_default(config);
|
spdk_conf_set_as_default(config);
|
||||||
global_rc = -1;
|
rc = spdk_scsi_init();
|
||||||
spdk_scsi_subsystem_init();
|
CU_ASSERT_EQUAL(rc, 0);
|
||||||
|
|
||||||
/* Assert the scsi_params.max_unmap_block_descriptor_count == 1 and
|
/* Assert the scsi_params.max_unmap_block_descriptor_count == 1 and
|
||||||
* assert the rest of the params are set to their default values */
|
* assert the rest of the params are set to their default values */
|
||||||
set_default_scsi_params(¶ms);
|
set_default_scsi_params(¶ms);
|
||||||
params.max_unmap_block_descriptor_count = 1;
|
params.max_unmap_block_descriptor_count = 1;
|
||||||
CU_ASSERT(memcmp(&g_spdk_scsi.scsi_params, ¶ms, sizeof(params)) == 0);
|
CU_ASSERT(memcmp(&g_spdk_scsi.scsi_params, ¶ms, sizeof(params)) == 0);
|
||||||
CU_ASSERT_EQUAL(global_rc, 0);
|
|
||||||
|
|
||||||
spdk_conf_free(config);
|
spdk_conf_free(config);
|
||||||
}
|
}
|
||||||
@ -189,20 +167,20 @@ scsi_init_set_optimal_unmap_granularity_config_param(void)
|
|||||||
{
|
{
|
||||||
struct spdk_scsi_parameters params;
|
struct spdk_scsi_parameters params;
|
||||||
struct spdk_conf *config;
|
struct spdk_conf *config;
|
||||||
|
int rc;
|
||||||
|
|
||||||
/* set scsi_params.optimal_unmap_granularity = 0
|
/* set scsi_params.optimal_unmap_granularity = 0
|
||||||
* of Scsi section */
|
* of Scsi section */
|
||||||
config = spdk_config_init_scsi_params("OptimalUnmapGranularity", "0");
|
config = spdk_config_init_scsi_params("OptimalUnmapGranularity", "0");
|
||||||
spdk_conf_set_as_default(config);
|
spdk_conf_set_as_default(config);
|
||||||
global_rc = -1;
|
rc = spdk_scsi_init();
|
||||||
spdk_scsi_subsystem_init();
|
CU_ASSERT_EQUAL(rc, 0);
|
||||||
|
|
||||||
/* Assert the scsi_params.optimal_unmap_granularity == 0 and
|
/* Assert the scsi_params.optimal_unmap_granularity == 0 and
|
||||||
* assert the rest of the params are set to their default values */
|
* assert the rest of the params are set to their default values */
|
||||||
set_default_scsi_params(¶ms);
|
set_default_scsi_params(¶ms);
|
||||||
params.optimal_unmap_granularity = 0;
|
params.optimal_unmap_granularity = 0;
|
||||||
CU_ASSERT(memcmp(&g_spdk_scsi.scsi_params, ¶ms, sizeof(params)) == 0);
|
CU_ASSERT(memcmp(&g_spdk_scsi.scsi_params, ¶ms, sizeof(params)) == 0);
|
||||||
CU_ASSERT_EQUAL(global_rc, 0);
|
|
||||||
|
|
||||||
spdk_conf_free(config);
|
spdk_conf_free(config);
|
||||||
}
|
}
|
||||||
@ -212,20 +190,20 @@ scsi_init_set_unmap_granularity_alignment_config_param(void)
|
|||||||
{
|
{
|
||||||
struct spdk_scsi_parameters params;
|
struct spdk_scsi_parameters params;
|
||||||
struct spdk_conf *config;
|
struct spdk_conf *config;
|
||||||
|
int rc;
|
||||||
|
|
||||||
/* set scsi_params.unmap_granularity_alignment = 0
|
/* set scsi_params.unmap_granularity_alignment = 0
|
||||||
* of Scsi section */
|
* of Scsi section */
|
||||||
config = spdk_config_init_scsi_params("UnmapGranularityAlignment", "0");
|
config = spdk_config_init_scsi_params("UnmapGranularityAlignment", "0");
|
||||||
spdk_conf_set_as_default(config);
|
spdk_conf_set_as_default(config);
|
||||||
global_rc = -1;
|
rc = spdk_scsi_init();
|
||||||
spdk_scsi_subsystem_init();
|
CU_ASSERT_EQUAL(rc, 0);
|
||||||
|
|
||||||
/* Assert the scsi_params.unmap_granularity_alignment == 0 and
|
/* Assert the scsi_params.unmap_granularity_alignment == 0 and
|
||||||
* assert the rest of the params are set to their default values */
|
* assert the rest of the params are set to their default values */
|
||||||
set_default_scsi_params(¶ms);
|
set_default_scsi_params(¶ms);
|
||||||
params.unmap_granularity_alignment = 0;
|
params.unmap_granularity_alignment = 0;
|
||||||
CU_ASSERT(memcmp(&g_spdk_scsi.scsi_params, ¶ms, sizeof(params)) == 0);
|
CU_ASSERT(memcmp(&g_spdk_scsi.scsi_params, ¶ms, sizeof(params)) == 0);
|
||||||
CU_ASSERT_EQUAL(global_rc, 0);
|
|
||||||
|
|
||||||
spdk_conf_free(config);
|
spdk_conf_free(config);
|
||||||
}
|
}
|
||||||
@ -235,20 +213,20 @@ scsi_init_ugavalid_yes(void)
|
|||||||
{
|
{
|
||||||
struct spdk_scsi_parameters params;
|
struct spdk_scsi_parameters params;
|
||||||
struct spdk_conf *config;
|
struct spdk_conf *config;
|
||||||
|
int rc;
|
||||||
|
|
||||||
/* set scsi_params.ugavalid = Yes
|
/* set scsi_params.ugavalid = Yes
|
||||||
* of Scsi section */
|
* of Scsi section */
|
||||||
config = spdk_config_init_scsi_params("Ugavalid", "Yes");
|
config = spdk_config_init_scsi_params("Ugavalid", "Yes");
|
||||||
spdk_conf_set_as_default(config);
|
spdk_conf_set_as_default(config);
|
||||||
global_rc = -1;
|
rc = spdk_scsi_init();
|
||||||
spdk_scsi_subsystem_init();
|
CU_ASSERT_EQUAL(rc, 0);
|
||||||
|
|
||||||
/* Assert the scsi_params.ugavalid == 1 and
|
/* Assert the scsi_params.ugavalid == 1 and
|
||||||
* assert the rest of the params are set to their default values */
|
* assert the rest of the params are set to their default values */
|
||||||
set_default_scsi_params(¶ms);
|
set_default_scsi_params(¶ms);
|
||||||
params.ugavalid = 1;
|
params.ugavalid = 1;
|
||||||
CU_ASSERT(memcmp(&g_spdk_scsi.scsi_params, ¶ms, sizeof(params)) == 0);
|
CU_ASSERT(memcmp(&g_spdk_scsi.scsi_params, ¶ms, sizeof(params)) == 0);
|
||||||
CU_ASSERT_EQUAL(global_rc, 0);
|
|
||||||
|
|
||||||
spdk_conf_free(config);
|
spdk_conf_free(config);
|
||||||
}
|
}
|
||||||
@ -258,20 +236,20 @@ scsi_init_ugavalid_no(void)
|
|||||||
{
|
{
|
||||||
struct spdk_scsi_parameters params;
|
struct spdk_scsi_parameters params;
|
||||||
struct spdk_conf *config;
|
struct spdk_conf *config;
|
||||||
|
int rc;
|
||||||
|
|
||||||
/* set scsi_params.ugavalid = No
|
/* set scsi_params.ugavalid = No
|
||||||
* of Scsi section */
|
* of Scsi section */
|
||||||
config = spdk_config_init_scsi_params("Ugavalid", "No");
|
config = spdk_config_init_scsi_params("Ugavalid", "No");
|
||||||
spdk_conf_set_as_default(config);
|
spdk_conf_set_as_default(config);
|
||||||
global_rc = -1;
|
rc = spdk_scsi_init();
|
||||||
spdk_scsi_subsystem_init();
|
CU_ASSERT_EQUAL(rc, 0);
|
||||||
|
|
||||||
/* Assert the scsi_params.ugavalid == 0 and
|
/* Assert the scsi_params.ugavalid == 0 and
|
||||||
* assert the rest of the params are set to their default values */
|
* assert the rest of the params are set to their default values */
|
||||||
set_default_scsi_params(¶ms);
|
set_default_scsi_params(¶ms);
|
||||||
params.ugavalid = 0;
|
params.ugavalid = 0;
|
||||||
CU_ASSERT(memcmp(&g_spdk_scsi.scsi_params, ¶ms, sizeof(params)) == 0);
|
CU_ASSERT(memcmp(&g_spdk_scsi.scsi_params, ¶ms, sizeof(params)) == 0);
|
||||||
CU_ASSERT_EQUAL(global_rc, 0);
|
|
||||||
|
|
||||||
spdk_conf_free(config);
|
spdk_conf_free(config);
|
||||||
}
|
}
|
||||||
@ -281,14 +259,14 @@ scsi_init_ugavalid_unknown_value_failure(void)
|
|||||||
{
|
{
|
||||||
struct spdk_scsi_parameters params;
|
struct spdk_scsi_parameters params;
|
||||||
struct spdk_conf *config;
|
struct spdk_conf *config;
|
||||||
|
int rc;
|
||||||
|
|
||||||
/* set scsi_params.ugavalid = unknown value
|
/* set scsi_params.ugavalid = unknown value
|
||||||
* of Scsi section */
|
* of Scsi section */
|
||||||
config = spdk_config_init_scsi_params("Ugavalid", "unknown value");
|
config = spdk_config_init_scsi_params("Ugavalid", "unknown value");
|
||||||
spdk_conf_set_as_default(config);
|
spdk_conf_set_as_default(config);
|
||||||
global_rc = -1;
|
rc = spdk_scsi_init();
|
||||||
spdk_scsi_subsystem_init();
|
CU_ASSERT_EQUAL(rc, 0);
|
||||||
CU_ASSERT_EQUAL(global_rc, 0);
|
|
||||||
|
|
||||||
/* Assert the scsi_params.ugavalid == DEFAULT_UGAVALID and
|
/* Assert the scsi_params.ugavalid == DEFAULT_UGAVALID and
|
||||||
* assert the rest of the params are set to their default values */
|
* assert the rest of the params are set to their default values */
|
||||||
@ -304,20 +282,20 @@ scsi_init_max_write_same_length(void)
|
|||||||
{
|
{
|
||||||
struct spdk_scsi_parameters params;
|
struct spdk_scsi_parameters params;
|
||||||
struct spdk_conf *config;
|
struct spdk_conf *config;
|
||||||
|
int rc;
|
||||||
|
|
||||||
/* set scsi_params.max_write_same_length = 512
|
/* set scsi_params.max_write_same_length = 512
|
||||||
* of Scsi section */
|
* of Scsi section */
|
||||||
config = spdk_config_init_scsi_params("MaxWriteSameLength", "512");
|
config = spdk_config_init_scsi_params("MaxWriteSameLength", "512");
|
||||||
spdk_conf_set_as_default(config);
|
spdk_conf_set_as_default(config);
|
||||||
global_rc = -1;
|
rc = spdk_scsi_init();
|
||||||
spdk_scsi_subsystem_init();
|
CU_ASSERT_EQUAL(rc, 0);
|
||||||
|
|
||||||
/* Assert the scsi_params.max_write_same_length == 512 and
|
/* Assert the scsi_params.max_write_same_length == 512 and
|
||||||
* assert the rest of the params are set to their default values */
|
* assert the rest of the params are set to their default values */
|
||||||
set_default_scsi_params(¶ms);
|
set_default_scsi_params(¶ms);
|
||||||
params.max_write_same_length = 512;
|
params.max_write_same_length = 512;
|
||||||
CU_ASSERT(memcmp(&g_spdk_scsi.scsi_params, ¶ms, sizeof(params)) == 0);
|
CU_ASSERT(memcmp(&g_spdk_scsi.scsi_params, ¶ms, sizeof(params)) == 0);
|
||||||
CU_ASSERT_EQUAL(global_rc, 0);
|
|
||||||
|
|
||||||
spdk_conf_free(config);
|
spdk_conf_free(config);
|
||||||
}
|
}
|
||||||
@ -327,19 +305,19 @@ scsi_init_read_config_scsi_params(void)
|
|||||||
{
|
{
|
||||||
struct spdk_scsi_parameters params;
|
struct spdk_scsi_parameters params;
|
||||||
struct spdk_conf *config;
|
struct spdk_conf *config;
|
||||||
|
int rc;
|
||||||
|
|
||||||
/* Set null for item's key and value;
|
/* Set null for item's key and value;
|
||||||
* set default scsi parameters */
|
* set default scsi parameters */
|
||||||
config = spdk_config_init_scsi_params("", "");
|
config = spdk_config_init_scsi_params("", "");
|
||||||
spdk_conf_set_as_default(config);
|
spdk_conf_set_as_default(config);
|
||||||
global_rc = -1;
|
rc = spdk_scsi_init();
|
||||||
spdk_scsi_subsystem_init();
|
CU_ASSERT_EQUAL(rc, 0);
|
||||||
|
|
||||||
/* Sets the default values for all the parameters
|
/* Sets the default values for all the parameters
|
||||||
* of the Scsi section and returns success */
|
* of the Scsi section and returns success */
|
||||||
set_default_scsi_params(¶ms);
|
set_default_scsi_params(¶ms);
|
||||||
CU_ASSERT(memcmp(&g_spdk_scsi.scsi_params, ¶ms, sizeof(params)) == 0);
|
CU_ASSERT(memcmp(&g_spdk_scsi.scsi_params, ¶ms, sizeof(params)) == 0);
|
||||||
CU_ASSERT_EQUAL(global_rc, 0);
|
|
||||||
|
|
||||||
spdk_conf_free(config);
|
spdk_conf_free(config);
|
||||||
}
|
}
|
||||||
@ -349,20 +327,20 @@ scsi_init_success(void)
|
|||||||
{
|
{
|
||||||
struct spdk_scsi_parameters params;
|
struct spdk_scsi_parameters params;
|
||||||
struct spdk_conf *config;
|
struct spdk_conf *config;
|
||||||
|
int rc;
|
||||||
|
|
||||||
/* Set null for item's key and value;
|
/* Set null for item's key and value;
|
||||||
* set default scsi parameters */
|
* set default scsi parameters */
|
||||||
config = spdk_config_init_scsi_params("", "");
|
config = spdk_config_init_scsi_params("", "");
|
||||||
spdk_conf_set_as_default(config);
|
spdk_conf_set_as_default(config);
|
||||||
global_rc = -1;
|
rc = spdk_scsi_init();
|
||||||
spdk_scsi_subsystem_init();
|
CU_ASSERT_EQUAL(rc, 0);
|
||||||
|
|
||||||
/* Sets the default values for all the parameters
|
/* Sets the default values for all the parameters
|
||||||
* of the Scsi section, initialize th device
|
* of the Scsi section, initialize th device
|
||||||
* and returns success */
|
* and returns success */
|
||||||
set_default_scsi_params(¶ms);
|
set_default_scsi_params(¶ms);
|
||||||
CU_ASSERT(memcmp(&g_spdk_scsi.scsi_params, ¶ms, sizeof(params)) == 0);
|
CU_ASSERT(memcmp(&g_spdk_scsi.scsi_params, ¶ms, sizeof(params)) == 0);
|
||||||
CU_ASSERT_EQUAL(global_rc, 0);
|
|
||||||
|
|
||||||
spdk_conf_free(config);
|
spdk_conf_free(config);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user