mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-11-08 11:03:41 +08:00
Compare commits
2 Commits
2e2017470e
...
78817ecfc1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
78817ecfc1 | ||
|
|
8de7f56ff8 |
19
src/proc.sh
19
src/proc.sh
@@ -7,7 +7,6 @@ set -Eeuo pipefail
|
|||||||
: "${HOST_CPU:=""}"
|
: "${HOST_CPU:=""}"
|
||||||
: "${CPU_FLAGS:=""}"
|
: "${CPU_FLAGS:=""}"
|
||||||
: "${CPU_MODEL:=""}"
|
: "${CPU_MODEL:=""}"
|
||||||
: "${DEF_MODEL:="qemu64"}"
|
|
||||||
|
|
||||||
CLOCKSOURCE="tsc"
|
CLOCKSOURCE="tsc"
|
||||||
[[ "${ARCH,,}" == "arm64" ]] && CLOCKSOURCE="arch_sys_counter"
|
[[ "${ARCH,,}" == "arm64" ]] && CLOCKSOURCE="arch_sys_counter"
|
||||||
@@ -27,9 +26,13 @@ else
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${ARCH,,}" != "amd64" ]]; then
|
if [[ "$KVM" == [Nn]* ]]; then
|
||||||
KVM="N"
|
warn "KVM acceleration is disabled, this will cause the machine to run about 10 times slower!"
|
||||||
warn "your CPU architecture is ${ARCH^^} and cannot provide KVM acceleration for x64 instructions, this will cause a major loss of performance."
|
else
|
||||||
|
if [[ "${ARCH,,}" != "amd64" ]]; then
|
||||||
|
KVM="N"
|
||||||
|
warn "your CPU architecture is ${ARCH^^} and cannot provide KVM acceleration for x64 instructions, so the machine will run about 10 times slower."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$KVM" != [Nn]* ]]; then
|
if [[ "$KVM" != [Nn]* ]]; then
|
||||||
@@ -52,7 +55,7 @@ if [[ "$KVM" != [Nn]* ]]; then
|
|||||||
if [ -n "$KVM_ERR" ]; then
|
if [ -n "$KVM_ERR" ]; then
|
||||||
KVM="N"
|
KVM="N"
|
||||||
if [[ "$OSTYPE" =~ ^darwin ]]; then
|
if [[ "$OSTYPE" =~ ^darwin ]]; then
|
||||||
warn "you are using macOS which has no KVM support, this will cause a major loss of performance."
|
warn "you are using macOS which has no KVM support, so the machine will run about 10 times slower."
|
||||||
else
|
else
|
||||||
kernel=$(uname -a)
|
kernel=$(uname -a)
|
||||||
case "${kernel,,}" in
|
case "${kernel,,}" in
|
||||||
@@ -61,7 +64,7 @@ if [[ "$KVM" != [Nn]* ]]; then
|
|||||||
*"synology"* )
|
*"synology"* )
|
||||||
error "Please make sure that Synology VMM (Virtual Machine Manager) is installed and that '/dev/kvm' is binded to this container." ;;
|
error "Please make sure that Synology VMM (Virtual Machine Manager) is installed and that '/dev/kvm' is binded to this container." ;;
|
||||||
*)
|
*)
|
||||||
error "KVM acceleration is not available $KVM_ERR, this will cause a major loss of performance."
|
error "KVM acceleration is not available $KVM_ERR, this will cause the machine to run about 10 times slower."
|
||||||
error "See the FAQ for possible causes, or continue without it by adding KVM: \"N\" (not recommended)." ;;
|
error "See the FAQ for possible causes, or continue without it by adding KVM: \"N\" (not recommended)." ;;
|
||||||
esac
|
esac
|
||||||
[[ "$DEBUG" != [Yy1]* ]] && exit 88
|
[[ "$DEBUG" != [Yy1]* ]] && exit 88
|
||||||
@@ -77,7 +80,7 @@ if [[ "$KVM" != [Nn]* ]]; then
|
|||||||
|
|
||||||
if ! grep -qw "sse4_2" <<< "$flags"; then
|
if ! grep -qw "sse4_2" <<< "$flags"; then
|
||||||
info "Your CPU does not have the SSE4 instruction set that Virtual DSM requires, it will be emulated..."
|
info "Your CPU does not have the SSE4 instruction set that Virtual DSM requires, it will be emulated..."
|
||||||
[ -z "$CPU_MODEL" ] && CPU_MODEL="$DEF_MODEL"
|
[ -z "$CPU_MODEL" ] && CPU_MODEL="qemu64"
|
||||||
CPU_FEATURES+=",+ssse3,+sse4.1,+sse4.2"
|
CPU_FEATURES+=",+ssse3,+sse4.1,+sse4.2"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -120,7 +123,7 @@ else
|
|||||||
CPU_MODEL="max"
|
CPU_MODEL="max"
|
||||||
CPU_FEATURES+=",migratable=no"
|
CPU_FEATURES+=",migratable=no"
|
||||||
else
|
else
|
||||||
CPU_MODEL="$DEF_MODEL"
|
CPU_MODEL="qemu64"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user