mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-09-18 23:14:48 +08:00
feat: Parse CPU flags (#1010)
This commit is contained in:
parent
238ebd273b
commit
10466d7851
24
src/proc.sh
24
src/proc.sh
@ -128,6 +128,30 @@ else
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "$ARGUMENTS" == *"-cpu host,"* ]]; then
|
||||||
|
|
||||||
|
args="${ARGUMENTS} "
|
||||||
|
prefix="${args/-cpu host,*/}"
|
||||||
|
suffix="${args/*-cpu host,/}"
|
||||||
|
param="${suffix%% *}"
|
||||||
|
suffix="${suffix#* }"
|
||||||
|
args="${prefix}${suffix}"
|
||||||
|
ARGUMENTS="${args::-1}"
|
||||||
|
|
||||||
|
if [ -z "$CPU_FLAGS" ]; then
|
||||||
|
CPU_FLAGS="$param"
|
||||||
|
else
|
||||||
|
CPU_FLAGS+=",$param"
|
||||||
|
fi
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
if [[ "$ARGUMENTS" == *"-cpu host"* ]]; then
|
||||||
|
ARGUMENTS="${ARGUMENTS//-cpu host/}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "$CPU_FLAGS" ]; then
|
if [ -z "$CPU_FLAGS" ]; then
|
||||||
if [ -z "$CPU_FEATURES" ]; then
|
if [ -z "$CPU_FEATURES" ]; then
|
||||||
CPU_FLAGS="$CPU_MODEL"
|
CPU_FLAGS="$CPU_MODEL"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user