Merge pull request #66 from ghostfreak3000/patch-1

Fallback to default qemu64 emulation when KVM not available
This commit is contained in:
Pavel Zloi 2025-08-21 09:36:10 +03:00 committed by GitHub
commit b4eaf7b592
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -49,13 +49,14 @@ KVM_OPTS=""
if [ -e /dev/kvm ]; then if [ -e /dev/kvm ]; then
if grep -q -e vmx -e svm /proc/cpuinfo; then if grep -q -e vmx -e svm /proc/cpuinfo; then
echo "Enabling KVM" echo "Enabling KVM"
CPU_FEATURES=",kvm=on" CPU_FEATURES="host,kvm=on"
KVM_OPTS="-machine accel=kvm -enable-kvm" KVM_OPTS="-machine accel=kvm -enable-kvm"
fi fi
fi fi
if [ "$CPU_FEATURES" = "" ]; then if [ "$CPU_FEATURES" = "" ]; then
echo "KVM not available, running in emulation mode. This will be slow." echo "KVM not available, running in emulation mode. This will be slow."
CPU_FEATURES="qemu64"
fi fi
# And run the VM! A brief explanation of the options here: # And run the VM! A brief explanation of the options here:
@ -70,7 +71,7 @@ exec qemu-system-x86_64 \
-nographic \ -nographic \
-m 512 \ -m 512 \
-smp 4,sockets=1,cores=4,threads=1 \ -smp 4,sockets=1,cores=4,threads=1 \
-cpu host$CPU_FEATURES \ -cpu $CPU_FEATURES \
$KVM_OPTS \ $KVM_OPTS \
-nic tap,id=qemu1,mac=54:05:AB:CD:12:31,script=$QEMU_IFUP,downscript=$QEMU_IFDOWN \ -nic tap,id=qemu1,mac=54:05:AB:CD:12:31,script=$QEMU_IFUP,downscript=$QEMU_IFDOWN \
"$@" \ "$@" \