mirror of
https://github.com/EvilFreelancer/docker-routeros.git
synced 2025-08-28 13:48:14 +02:00
Merge pull request #66 from ghostfreak3000/patch-1
Fallback to default qemu64 emulation when KVM not available
This commit is contained in:
commit
b4eaf7b592
1 changed files with 3 additions and 2 deletions
|
@ -49,13 +49,14 @@ KVM_OPTS=""
|
|||
if [ -e /dev/kvm ]; then
|
||||
if grep -q -e vmx -e svm /proc/cpuinfo; then
|
||||
echo "Enabling KVM"
|
||||
CPU_FEATURES=",kvm=on"
|
||||
CPU_FEATURES="host,kvm=on"
|
||||
KVM_OPTS="-machine accel=kvm -enable-kvm"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$CPU_FEATURES" = "" ]; then
|
||||
echo "KVM not available, running in emulation mode. This will be slow."
|
||||
CPU_FEATURES="qemu64"
|
||||
fi
|
||||
|
||||
# And run the VM! A brief explanation of the options here:
|
||||
|
@ -70,7 +71,7 @@ exec qemu-system-x86_64 \
|
|||
-nographic \
|
||||
-m 512 \
|
||||
-smp 4,sockets=1,cores=4,threads=1 \
|
||||
-cpu host$CPU_FEATURES \
|
||||
-cpu $CPU_FEATURES \
|
||||
$KVM_OPTS \
|
||||
-nic tap,id=qemu1,mac=54:05:AB:CD:12:31,script=$QEMU_IFUP,downscript=$QEMU_IFDOWN \
|
||||
"$@" \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue