aboutgitcodebugslistschat
path: root/test/lib/setup
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2022-07-06 17:28:58 +1000
committerStefano Brivio <sbrivio@redhat.com>2022-07-14 01:32:42 +0200
commit7bcc5930a66ed8d6ba692a2463547d17390531e7 (patch)
tree5e02a9a14eb0b365b0899185cac55bfc4c20e15a /test/lib/setup
parentc4d8a77512bf7e8224f3aff930ed48a680b4ea53 (diff)
downloadpasst-7bcc5930a66ed8d6ba692a2463547d17390531e7.tar
passt-7bcc5930a66ed8d6ba692a2463547d17390531e7.tar.gz
passt-7bcc5930a66ed8d6ba692a2463547d17390531e7.tar.bz2
passt-7bcc5930a66ed8d6ba692a2463547d17390531e7.tar.lz
passt-7bcc5930a66ed8d6ba692a2463547d17390531e7.tar.xz
passt-7bcc5930a66ed8d6ba692a2463547d17390531e7.tar.zst
passt-7bcc5930a66ed8d6ba692a2463547d17390531e7.zip
Invoke specific qemu-system-* binaries
A lot of tests and examples invoke qemu with the command "kvm". However, as far as I can tell, "kvm" being aliased to the appropriate qemu system binary is Debian specific. The binary names from qemu upstream - qemu-system-$ARCH - also aren't universal, but they are more common (they should be good for both Debian and Fedora at least). In order to still get KVM acceleration when available, we use the option "-M accel=kvm:tcg" to tell qemu to try using either KVM or TCG in that order A number of the places we invoked "kvm" are expecting specifically an x86 guest, and so it's also safer to explicitly invoke qemu-system-x86_64. Some others appear to be independent of the target arch (just wanting the same arch as the host to allow KVM acceleration). Although I suspect there may be more subtle x86 specific options in the qemu command lines, attempt to preserve arch independence by using $(uname -m). Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'test/lib/setup')
-rwxr-xr-xtest/lib/setup17
1 files changed, 13 insertions, 4 deletions
diff --git a/test/lib/setup b/test/lib/setup
index afa5101..97e603c 100755
--- a/test/lib/setup
+++ b/test/lib/setup
@@ -58,7 +58,9 @@ setup_passt() {
pane_run PASST "valgrind --max-stackframe=$((4 * 1024 * 1024)) --trace-children=yes --vgdb=no --error-exitcode=1 --suppressions=test/valgrind.supp ./passt ${__opts} -f -t 10001 -u 10001 -P passt.pid"
sleep 5
- pane_run GUEST './qrap 5 kvm -m '${VMEM}' -cpu host -smp '${VCPUS} \
+ pane_run GUEST './qrap 5 qemu-system-$(uname -m)' \
+ ' -machine accel=kvm' \
+ ' -m '${VMEM}' -cpu host -smp '${VCPUS} \
' -kernel ' "/boot/vmlinuz-$(uname -r)" \
' -initrd mbuto.img -nographic -serial stdio' \
' -nodefaults' \
@@ -170,7 +172,10 @@ setup_passt_in_ns() {
fi
sleep 5
- pane_run GUEST './qrap 5 kvm -m '${VMEM}' -cpu host -smp '${VCPUS} \
+ pane_run GUEST './qrap 5 qemu-system-$(uname -m)' \
+ ' -machine accel=kvm' \
+ ' -M accel=kvm:tcg' \
+ ' -m '${VMEM}' -cpu host -smp '${VCPUS} \
' -kernel ' "/boot/vmlinuz-$(uname -r)" \
' -initrd mbuto.img -nographic -serial stdio' \
' -nodefaults' \
@@ -259,7 +264,9 @@ setup_two_guests() {
pane_run GUEST_2 'cp mbuto.img mbuto_2.img'
pane_status GUEST_2
- pane_run GUEST_1 './qrap 5 kvm -m '${VMEM}' -cpu host -smp '${VCPUS} \
+ pane_run GUEST_1 './qrap 5 qemu-system-$(uname -m)' \
+ ' -M accel=kvm:tcg' \
+ ' -m '${VMEM}' -cpu host -smp '${VCPUS} \
' -kernel ' "/boot/vmlinuz-$(uname -r)" \
' -initrd mbuto.img -nographic -serial stdio' \
' -nodefaults' \
@@ -267,7 +274,9 @@ setup_two_guests() {
'virtio-net.napi_tx=1"' \
" -device virtio-net-pci,netdev=hostnet0,x-txburst=16384" \
" -netdev socket,fd=5,id=hostnet0"
- pane_run GUEST_2 './qrap 5 kvm -m '${VMEM}' -cpu host -smp '${VCPUS} \
+ pane_run GUEST_2 './qrap 5 qemu-system-$(uname -m)' \
+ ' -M accel=kvm:tcg' \
+ ' -m '${VMEM}' -cpu host -smp '${VCPUS} \
' -kernel ' "/boot/vmlinuz-$(uname -r)" \
' -initrd mbuto_2.img -nographic -serial stdio' \
' -nodefaults' \