From f25dc399c294bdacc6cfabdd0f71161ebc408773 Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Tue, 4 Dec 2018 09:05:00 +0100 Subject: [PATCH] run_qemu.sh: only add -enable-kvm if /dev/kvm exists --- run_qemu.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/run_qemu.sh b/run_qemu.sh index 94b2894..a198802 100755 --- a/run_qemu.sh +++ b/run_qemu.sh @@ -8,7 +8,11 @@ tmpdir="$(mktemp -d)" # the path to debian-unstable.qcow must be absolute or otherwise qemu will # look for the path relative to debian-unstable-overlay.qcow qemu-img create -f qcow2 -b "$(realpath $cachedir)/debian-unstable.qcow" "$tmpdir/debian-unstable-overlay.qcow" -qemu-system-x86_64 -enable-kvm -m 512M -nographic \ +KVM= +if [ -e /dev/kvm ]; then + KVM="-enable-kvm" +fi +qemu-system-x86_64 $KVM -m 512M -nographic \ -monitor unix:/tmp/monitor,server,nowait \ -serial unix:/tmp/ttyS0,server,nowait \ -serial unix:/tmp/ttyS1,server,nowait \