From 971451a84a0fd01f956025af9908a3e8b624263e Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Fri, 29 Apr 2022 11:27:48 +0200 Subject: [PATCH] perf/vhost: Allow to add extra fio config through $fio_extra_conf $fio_extra_conf can either point at an existing file or be an attached stdin the fio_conf() should read from. Signed-off-by: Michal Berger Change-Id: If902262b0100fb056491928b3f667ab15e6e0024 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12429 Tested-by: SPDK CI Jenkins Reviewed-by: Karol Latecki Reviewed-by: Tomasz Zawadzki Reviewed-by: Jim Harris --- scripts/perf/vhost/run_vhost_test.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/perf/vhost/run_vhost_test.sh b/scripts/perf/vhost/run_vhost_test.sh index 6452f8ab7..4093fe56d 100755 --- a/scripts/perf/vhost/run_vhost_test.sh +++ b/scripts/perf/vhost/run_vhost_test.sh @@ -5,6 +5,9 @@ rootdir=$(readlink -f "$curdir/../../../") source "$rootdir/test/vhost/common.sh" +# Allow for the fio_conf() to slurp extra config from the stdin. +exec {fio_extra_conf}<&0 + fio_conf() { cat <<- FIO [global] @@ -25,6 +28,14 @@ fio_conf() { FIO_URING fi + if [[ -e $fio_extra_conf ]]; then + # Overriden through cmdline|env + cat "$fio_extra_conf" + elif [[ ! -t $fio_extra_conf ]]; then + # Attached to stdin + cat <&"$fio_extra_conf" + fi + cat <<- FIO [perf_test] stonewall