mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-06-08 09:27:45 +08:00
feat: KVM flag
This commit is contained in:
parent
10915a601c
commit
8925323a6e
@ -5,7 +5,7 @@ KVM_ERR=""
|
|||||||
KVM_OPTS=""
|
KVM_OPTS=""
|
||||||
QEMU_CPU="qemu64,+ssse3,+sse4,+sse4.1,+sse4.2"
|
QEMU_CPU="qemu64,+ssse3,+sse4,+sse4.1,+sse4.2"
|
||||||
|
|
||||||
if [ "$ARCH" == "amd64" ]; then
|
if [ "$ARCH" == "amd64" ] && [[ "$KVM" != [Nn]* ]]; then
|
||||||
|
|
||||||
if [ -e /dev/kvm ] && sh -c 'echo -n > /dev/kvm' &> /dev/null; then
|
if [ -e /dev/kvm ] && sh -c 'echo -n > /dev/kvm' &> /dev/null; then
|
||||||
if ! grep -q -e vmx -e svm /proc/cpuinfo; then
|
if ! grep -q -e vmx -e svm /proc/cpuinfo; then
|
||||||
@ -18,7 +18,7 @@ if [ "$ARCH" == "amd64" ]; then
|
|||||||
if [ -n "$KVM_ERR" ]; then
|
if [ -n "$KVM_ERR" ]; then
|
||||||
error "KVM acceleration not detected $KVM_ERR, this will cause a major loss of performance."
|
error "KVM acceleration not detected $KVM_ERR, this will cause a major loss of performance."
|
||||||
error "See the FAQ on how to enable it, or skip this error by setting KVM=N (not recommended)."
|
error "See the FAQ on how to enable it, or skip this error by setting KVM=N (not recommended)."
|
||||||
[[ "$KVM" != [Nn]* ]] && [[ "$DEBUG" != [Yy1]* ]] && exit 88
|
[[ "$DEBUG" != [Yy1]* ]] && exit 88
|
||||||
[ "$CPU_MODEL" == "host"* ] && CPU_MODEL="$QEMU_CPU"
|
[ "$CPU_MODEL" == "host"* ] && CPU_MODEL="$QEMU_CPU"
|
||||||
else
|
else
|
||||||
KVM_OPTS=",accel=kvm -enable-kvm"
|
KVM_OPTS=",accel=kvm -enable-kvm"
|
||||||
@ -30,8 +30,11 @@ if [ "$ARCH" == "amd64" ]; then
|
|||||||
CPU_MODEL="host,+ssse3,+sse4,+sse4.1,+sse4.2"
|
CPU_MODEL="host,+ssse3,+sse4,+sse4.1,+sse4.2"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
[ "$CPU_MODEL" == "host"* ] && CPU_MODEL="$QEMU_CPU"
|
[ "$CPU_MODEL" == "host"* ] && CPU_MODEL="$QEMU_CPU"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user