From 5aa5ce4d280e646b38fbac81f7676a7a0899db8a Mon Sep 17 00:00:00 2001 From: Rafael Fonseca Date: Wed, 20 Feb 2019 22:34:09 +0100 Subject: [PATCH] src/cmdlib.sh: qemu invocation is arch-specific Fixes #314 Signed-off-by: Rafael Fonseca --- src/cmdlib.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/cmdlib.sh b/src/cmdlib.sh index 5e8b4b71f8..6b9f41b3bc 100755 --- a/src/cmdlib.sh +++ b/src/cmdlib.sh @@ -250,7 +250,13 @@ EOF if [ -x /usr/libexec/qemu-kvm ]; then QEMU_KVM="/usr/libexec/qemu-kvm" else - QEMU_KVM="qemu-system-$(arch) -accel kvm" + # Enable arch-specific options for qemu + case "$(arch)" in + "x86_64") QEMU_KVM="qemu-system-$(arch) -accel kvm" ;; + "aarch64") QEMU_KVM="qemu-system-$(arch) -accel kvm -M virt" ;; + "ppc64le") QEMU_KVM="qemu-system-ppc64 -accel kvm" ;; + *) fatal "Architecture $(arch) not supported" + esac fi runvm() { @@ -293,7 +299,7 @@ EOF srcvirtfs=("-virtfs" "local,id=source,path=${workdir}/src/config,security_model=none,mount_tag=source") fi - ${QEMU_KVM} -nodefaults -nographic -m 2048 -no-reboot \ + ${QEMU_KVM} -nodefaults -nographic -m 2048 -no-reboot -cpu host \ -kernel "${vmbuilddir}/kernel" \ -initrd "${vmbuilddir}/initrd" \ -netdev user,id=eth0,hostname=supermin \