Merge "add get_platform_cpus"

This commit is contained in:
Zuul 2019-08-02 18:41:31 +00:00 committed by Gerrit Code Review
commit b61a45090a
3 changed files with 13 additions and 1 deletions

View File

@ -1,3 +1,3 @@
SRC_DIR="worker-utils"
COPY_LIST="$SRC_DIR/LICENSE"
TIS_PATCH_VER=3
TIS_PATCH_VER=4

View File

@ -13,6 +13,7 @@ BuildRequires: systemd-devel
Requires: systemd
Requires: python
Requires: /bin/systemctl
Requires: perl
%description
Initial worker node resource reservation and misc. utilities

View File

@ -268,6 +268,17 @@ function get_platform_cpu_list {
echo ${PLATFORM_CPULIST}
}
################################################################################
# Return number of CPUs reserved for platform
################################################################################
function get_platform_cpus {
local PLATFORM_CPULIST
PLATFORM_CPULIST=($(platform_expanded_cpu_list | \
perl -pe 's/(\d+)-(\d+)/join(",",$1..$2)/eg'| \
sed 's/,/ /g'))
echo ${#PLATFORM_CPULIST[@]}
}
################################################################################
# Return list of CPUs reserved for vswitch
################################################################################