Skip to content

Commit 88513ae

Browse files
committed
torture: Remove qemu dependency on EFI firmware
On some (probably misconfigured) systems, the torture-test scripting will cause qemu to complain about missing EFI firmware, often because qemu is trying to traverse broken symbolic links to find that firmware. Which is a bit silly given that the default torture-test guest OS has but a single binary for its userspace, and thus is unlikely to do much in the way of networking in any case. This commit therefore avoids such problems by specifying "-net none" to qemu unless the TORTURE_QEMU_INTERACTIVE environment variable is set (for example, by having specified "--interactive" to kvm.sh), in which case "-net nic -net user" is specified to qemu instead. Either choice may be overridden by specifying the "-net" argument of your choice to the kvm.sh "--qemu-args" parameter. Link: https://lore.kernel.org/lkml/[email protected] Reported-by: Joel Fernandes <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]> Cc: Sebastian Andrzej Siewior <[email protected]>
1 parent 9ebcfad commit 88513ae

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

tools/testing/selftests/rcutorture/bin/functions.sh

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,6 @@ identify_qemu_args () {
215215
then
216216
echo -device spapr-vlan,netdev=net0,mac=$TORTURE_QEMU_MAC
217217
echo -netdev bridge,br=br0,id=net0
218-
elif test -n "$TORTURE_QEMU_INTERACTIVE"
219-
then
220-
echo -net nic -net user
221218
fi
222219
;;
223220
esac
@@ -275,3 +272,21 @@ specify_qemu_cpus () {
275272
esac
276273
fi
277274
}
275+
276+
# specify_qemu_net qemu-args
277+
#
278+
# Appends a string containing "-net none" to qemu-args, unless the incoming
279+
# qemu-args already contains "-smp" or unless the TORTURE_QEMU_INTERACTIVE
280+
# environment variable is set, in which case the string that is be added is
281+
# instead "-net nic -net user".
282+
specify_qemu_net () {
283+
if echo $1 | grep -q -e -net
284+
then
285+
echo $1
286+
elif test -n "$TORTURE_QEMU_INTERACTIVE"
287+
then
288+
echo $1 -net nic -net user
289+
else
290+
echo $1 -net none
291+
fi
292+
}

tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ then
141141
cpu_count=$TORTURE_ALLOTED_CPUS
142142
fi
143143
qemu_args="`specify_qemu_cpus "$QEMU" "$qemu_args" "$cpu_count"`"
144+
qemu_args="`specify_qemu_net "$qemu_args"`"
144145

145146
# Generate architecture-specific and interaction-specific qemu arguments
146147
qemu_args="$qemu_args `identify_qemu_args "$QEMU" "$resdir/console.log"`"

0 commit comments

Comments
 (0)