test/bdevperf: handle properly if not able to get io_channel

To fix issue: 2719

In this case, if there is successfully configured job and continue_on_failure (-f)
parameter is set, it will continue to run for these jobs. Otherwise, it will just
stop.

Change-Id: Ia2940a9e1b5da63e50857da11ff7f811c7576e3e
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14747
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
GangCao 2022-09-29 03:04:55 -04:00 committed by Tomasz Zawadzki
parent 8afb3d0037
commit 96679a2910

View File

@ -1122,6 +1122,12 @@ _bdevperf_construct_job_done(void *ctx)
/* Ready to run the test */
bdevperf_test();
} else if (g_run_rc != 0) {
/* Reset error as some jobs constructed right */
g_run_rc = 0;
if (g_continue_on_failure == false) {
g_error_to_exit = true;
}
}
}
@ -1196,6 +1202,8 @@ _bdevperf_construct_job(void *ctx)
if (!job->ch) {
SPDK_ERRLOG("Could not get io_channel for device %s, error=%d\n", spdk_bdev_get_name(job->bdev),
rc);
spdk_bdev_close(job->bdev_desc);
TAILQ_REMOVE(&g_bdevperf.jobs, job, link);
g_run_rc = -ENOMEM;
goto end;
}