bdevperf: Move g_target_count check into bdevperf_test()
Subsequent patches will make bdevperf_construct_targets() asynchronous and call bdevperf_test() as its callback. Moving g_target_count check into bdevperf_test() will make the change easier. As a result of this move, rpc_perform_test() is simplified a little. Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: I308ab472a0021278af1a1f5aa65268126a60673f Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478760 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
fd9c6a3d66
commit
15cc012336
@ -1263,6 +1263,11 @@ bdevperf_test(void)
|
||||
struct spdk_event *event;
|
||||
int rc;
|
||||
|
||||
if (g_target_count == 0) {
|
||||
fprintf(stderr, "No valid bdevs found.\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
rc = bdevperf_construct_targets_tasks();
|
||||
if (rc) {
|
||||
return rc;
|
||||
@ -1309,12 +1314,6 @@ bdevperf_run(void *arg1)
|
||||
|
||||
bdevperf_construct_targets();
|
||||
|
||||
if (g_target_count == 0) {
|
||||
fprintf(stderr, "No valid bdevs found.\n");
|
||||
spdk_app_stop(1);
|
||||
return;
|
||||
}
|
||||
|
||||
rc = bdevperf_test();
|
||||
if (rc) {
|
||||
spdk_app_stop(1);
|
||||
@ -1456,13 +1455,6 @@ rpc_perform_tests(struct spdk_jsonrpc_request *request, const struct spdk_json_v
|
||||
g_request = request;
|
||||
|
||||
bdevperf_construct_targets();
|
||||
if (g_target_count == 0) {
|
||||
g_request = NULL;
|
||||
fprintf(stderr, "No valid bdevs found.\n");
|
||||
spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR,
|
||||
spdk_strerror(-ENODEV));
|
||||
return;
|
||||
}
|
||||
|
||||
rc = bdevperf_test();
|
||||
if (rc) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user