diff options
author | Helmut Grohne <helmut@subdivi.de> | 2023-01-21 07:54:31 +0100 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2023-01-21 07:54:31 +0100 |
commit | a69b9eb9ae65f516cb7b5b99448e0124da88de89 (patch) | |
tree | d3b0f0b8dcd86ce51a778f6996b931465b2513bf /bin | |
parent | 0ccdbb096703c4194790662b9e9526d3bf955816 (diff) | |
download | debvm-a69b9eb9ae65f516cb7b5b99448e0124da88de89.tar.gz |
debvm-run: prefer qemu-system-* over kvm
Now that we pass accel=kvm:tcg, there is no difference anymore.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/debvm-run | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/bin/debvm-run b/bin/debvm-run index 6984528..5884551 100755 --- a/bin/debvm-run +++ b/bin/debvm-run @@ -217,20 +217,38 @@ set -- \ -device "virtio-net-pci,netdev=net0" \ "$@" +QEMU="qemu-system-$VMARCH" MACHINE= MAX_SMP= case "$VMARCH" in amd64) + QEMU=qemu-system-x86_64 MACHINE="type=q35" ;; - arm|arm64|armel|armhf|riscv64) + arm|armel|armhf) + MACHINE="type=virt" + ;; + arm64) + QEMU=qemu-system-aarch64 + MACHINE="type=virt" + ;; + powerpc) + QEMU=qemu-system-ppc + ;; + ppc64el) + QEMU=qemu-system-ppc64 + ;; + riscv64) MACHINE="type=virt" ;; esac if test "$ARCHITECTURE" = "$VMARCH"; then - QEMU=kvm + if ! command -v "$QEMU" >/dev/null 2>&1; then + # Fall back to kvm in case we badly guessed qemu. + QEMU=kvm + fi MACHINE="${MACHINE:+$MACHINE,}accel=kvm:tcg" # While kvm will fall back gracefully, the following options can only # be passed when kvm really is available. @@ -241,39 +259,20 @@ if test "$ARCHITECTURE" = "$VMARCH"; then fi fi else - QEMU="qemu-system-$VMARCH" case "$VMARCH" in - amd64) - QEMU=qemu-system-x86_64 - ;; arm64) - QEMU=qemu-system-aarch64 set -- -cpu max "$@" ;; arm|armel|armhf) - QEMU=qemu-system-arm set -- -cpu max "$@" ;; - powerpc) - QEMU=qemu-system-ppc - MAX_SMP=1 - ;; - ppc64el) - QEMU=qemu-system-ppc64 - ;; - m68k) + m68k|mipsel|powerpc|sparc64) MAX_SMP=1 ;; mips64el) MAX_SMP=1 set -- -cpu 5KEc "$@" ;; - mipsel) - MAX_SMP=1 - ;; - sparc64) - MAX_SMP=1 - ;; esac fi |