Skip to content

Commit

Permalink
src/cmdlib.sh: qemu invocation is arch-specific
Browse files Browse the repository at this point in the history
Fixes coreos#314

Signed-off-by: Rafael Fonseca <[email protected]>
  • Loading branch information
r4f4 committed Feb 20, 2019
1 parent cb17a04 commit 5aa5ce4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/cmdlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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 \
Expand Down

0 comments on commit 5aa5ce4

Please sign in to comment.