Commit 1fd01070 authored by Jim Harris's avatar Jim Harris
Browse files

bdevperf: print error message and exit when no bdevs found



While here, don't print out empty performance data if the
test run failed (for example, if no bdevs were found).  Also
remove superfluous "done" message at the end of main - it
really serves no purpose and looks silly especially if the
test failed.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I19c678bee9079f6aa453a4b925819a5ea27f6534

Reviewed-on: https://review.gerrithub.io/414064


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 8cb3341e
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -711,6 +711,12 @@ bdevperf_run(void *arg1, void *arg2)

	bdevperf_construct_targets();

	if (g_target_count == 0) {
		fprintf(stderr, "No valid bdevs found.\n");
		spdk_app_stop(1);
		return;
	}

	rc = bdevperf_construct_targets_tasks();
	if (rc) {
		blockdev_heads_destroy();
@@ -980,13 +986,14 @@ main(int argc, char **argv)
	}

	if (g_time_in_usec) {
		if (!g_run_failed) {
			performance_dump(g_time_in_usec, 0);
		}
	} else {
		printf("Test time less than one microsecond, no performance data will be shown\n");
	}

	blockdev_heads_destroy();
	spdk_app_fini();
	printf("done.\n");
	return g_run_failed;
}