From 7bcc5930a66ed8d6ba692a2463547d17390531e7 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Wed, 6 Jul 2022 17:28:58 +1000 Subject: 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 --- test/distro/opensuse | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/distro/opensuse') diff --git a/test/distro/opensuse b/test/distro/opensuse index 2b49a5b..18e1c81 100644 --- a/test/distro/opensuse +++ b/test/distro/opensuse @@ -12,7 +12,7 @@ # Author: Stefano Brivio temp PIDFILE -htools wget virt-edit guestfish head sed cat kill kvm qemu-system-aarch64 xzcat tr +htools wget virt-edit guestfish head sed cat kill qemu-system-x86_64 qemu-system-aarch64 xzcat tr # Quick pasta test: send message from init to ns, and from ns to init def distro_quick_pasta_test @@ -51,7 +51,7 @@ host guestfish --rw -a __IMG__ -i rm /etc/systemd/system/default.target.wants/je host virt-edit -a __IMG__ /etc/systemd/system/getty.target.wants/getty@tty1.service -e 's/ExecStart=.*/ExecStart=\/sbin\/agetty --timeout 5000 --autologin root -i -8 --keep-baud 115200,38400,9600 ttyS0 $TERM/g' host guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/ -host ./qrap 5 kvm -M pc -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -net socket,fd=5 -net nic,model=virtio +host ./qrap 5 qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -net socket,fd=5 -net nic,model=virtio host PS1='$ ' host ip link set eth0 up sleep 2 @@ -79,7 +79,7 @@ host guestfish --rw -a __IMG__ -i rm /etc/systemd/system/default.target.wants/je host virt-edit -a __IMG__ /etc/systemd/system/getty.target.wants/getty@tty1.service -e 's/ExecStart=.*/ExecStart=\/sbin\/agetty --timeout 5000 --autologin root -i -8 --keep-baud 115200,38400,9600 ttyS0 $TERM/g' host guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/ -host ./qrap 5 kvm -M pc -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -net socket,fd=5 -net nic,model=virtio +host ./qrap 5 qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -net socket,fd=5 -net nic,model=virtio host PS1='$ ' host ip link set eth0 up sleep 2 @@ -104,7 +104,7 @@ host guestfish --rw -a __IMG__ -i rm /etc/systemd/system/default.target.wants/je host virt-edit -a __IMG__ /etc/systemd/system/getty.target.wants/getty@tty1.service -e 's/ExecStart=.*/ExecStart=\/sbin\/agetty --timeout 5000 --autologin root -i -8 --keep-baud 115200,38400,9600 ttyS0 $TERM/g' host guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/ -host ./qrap 5 kvm -M pc -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -net socket,fd=5 -net nic,model=virtio +host ./qrap 5 qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -net socket,fd=5 -net nic,model=virtio # Multiple prompt logins might come up here sleep 10 host PS1='$ ' @@ -186,7 +186,7 @@ host guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/serial-getty@.servi host virt-edit -a __IMG__ /etc/systemd/system/getty.target.wants/getty@tty1.service -e 's/ExecStart=.*/ExecStart=\/sbin\/agetty --timeout 5000 --autologin root -i -8 --keep-baud 115200,38400,9600 ttyS0 $TERM/g' host guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/ -host ./qrap 5 kvm -M pc -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -net socket,fd=5 -net nic,model=virtio +host ./qrap 5 qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -net socket,fd=5 -net nic,model=virtio host PS1='$ ' host ip link set ens2 up sleep 2 -- cgit v1.2.3