test/nvme/reset: exit the test if no controllers avaiable
Fix the issue #386. Change-Id: I2d7434d6204a7f074f985584fb18b4f5f1f23f5c Signed-off-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-on: https://review.gerrithub.io/421070 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
parent
3599aa1093
commit
8d127f780b
@ -634,11 +634,21 @@ int main(int argc, char **argv)
|
||||
spdk_env_opts_init(&opts);
|
||||
opts.name = "reset";
|
||||
opts.core_mask = "0x1";
|
||||
opts.shm_id = 0;
|
||||
if (spdk_env_init(&opts) < 0) {
|
||||
fprintf(stderr, "Unable to initialize SPDK env\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (register_controllers() != 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!g_controllers) {
|
||||
printf("No NVMe controller found, %s exiting\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
task_pool = spdk_mempool_create("task_pool", TASK_POOL_NUM,
|
||||
sizeof(struct reset_task),
|
||||
64, SPDK_ENV_SOCKET_ID_ANY);
|
||||
@ -653,10 +663,6 @@ int main(int argc, char **argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (register_controllers() != 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (associate_workers_with_ns() != 0) {
|
||||
rc = 1;
|
||||
goto cleanup;
|
||||
|
Loading…
x
Reference in New Issue
Block a user