[PATCH 5/6] torture: Make kvm.sh ignore empty-string arguments
From: Paul E. McKenney
Date: Mon Nov 16 2026 - 12:26:58 EST
This commit makes kvm.sh ignore empty-string arguments in order to
simplify some scripting use cases of kvm.sh. In many cases, as pointed
out by Mathieu Desnoyers, the calling script would do better to use the
bash ${:+} substitution pattern. For an example already in torture.sh,
${qemu_args:+--qemu-args "$qemu_args"} expands to nothingness if qemu_args
is empty, but otherwise expands to a "--qemu-args " prepended to it value.
Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxx>
---
tools/testing/selftests/rcutorture/bin/kvm.sh | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
index 32c3199976388..86dd5c131d226 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -271,6 +271,9 @@ do
--trust-make)
TORTURE_TRUST_MAKE="y"
;;
+ "")
+ # torture.sh can pass empty arguments. Ignore them.
+ ;;
*)
echo Unknown argument $1
usage
--
2.40.1