SOURCES: util-vserver-cpuset.patch - working

baggins baggins at pld-linux.org
Fri Nov 25 16:57:38 CET 2005


Author: baggins                      Date: Fri Nov 25 15:57:38 2005 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- working

---- Files affected:
SOURCES:
   util-vserver-cpuset.patch (1.4 -> 1.5) 

---- Diffs:

================================================================
Index: SOURCES/util-vserver-cpuset.patch
diff -u SOURCES/util-vserver-cpuset.patch:1.4 SOURCES/util-vserver-cpuset.patch:1.5
--- SOURCES/util-vserver-cpuset.patch:1.4	Fri Nov 25 15:14:43 2005
+++ SOURCES/util-vserver-cpuset.patch	Fri Nov 25 16:57:32 2005
@@ -13,7 +13,7 @@
  declare -a SETUP_FLAGS=()
  
 -declare -r SETUP_OPTIONS="confdir:,lockfile:,hostname:,netdev:,netmask:,netprefix:,netbcast:,interface:,flags:,context:,initstyle:"
-+declare -r SETUP_OPTIONS="confdir:,lockfile:,hostname:,netdev:,netmask:,netprefix:,netbcast:,interface:,flags:,context:,initstyle:,cpuset,cpusetcpus,cpusetmems:"
++declare -r SETUP_OPTIONS="confdir:,lockfile:,hostname:,netdev:,netmask:,netprefix:,netbcast:,interface:,flags:,context:,initstyle:,cpuset:,cpusetcpus:,cpusetmems:"
  declare -r SETUP_HELPMSG=$"
      --context   ...  the static context of the vserver [default: none; a dynamic
                       context will be assumed]
@@ -34,7 +34,7 @@
      --initstyle <style>
                  ...  configures the initstyle (e.g. minit,sysv,plain)
  "
-@@ -72,6 +85,19 @@
+@@ -72,6 +85,21 @@
  	(--netbcast)	SETUP_NETBCAST=$2;;
  	(--interface)	SETUP_INTERFACES=( "${SETUP_INTERFACES[@]}" "$2" );;
  	(--initstyle)   SETUP_INITSTYLE=$2;;
@@ -49,8 +49,10 @@
 +	(--cpusetmems)	old_IFS=$IFS
 +			IFS=:
 +			set -- $2
-+			SETUP_CPUSETMEMS=$1;;
-+			SETUP_CPUSETMEMSEXCL=$1;;
++			SETUP_CPUSETMEMS=$1
++			SETUP_CPUSETMEMSEXCL=$2
++			IFS=$old_IFS
++			;;
  	(--flags)	old_IFS=$IFS
  			IFS=,
  			set -- $2
@@ -78,7 +80,7 @@
 diff -ur util-vserver-0.30.209/scripts/vserver.functions util-vserver-0.30.209.cpuset/scripts/vserver.functions
 --- util-vserver-0.30.209/scripts/vserver.functions	2005-11-25 14:30:27.665999880 +0100
 +++ util-vserver-0.30.209.cpuset/scripts/vserver.functions	2005-11-25 15:11:04.593027880 +0100
-@@ -687,6 +687,48 @@
+@@ -687,6 +687,54 @@
      fi
  }
  
@@ -88,6 +90,7 @@
 +    local cpuset
 +    local f="$vdir"/cpuset
 +    local i
++    local v
 +
 +    test -d "$f" || return 0
 +    test -e "$f"/name || return 0
@@ -96,7 +99,12 @@
 +    test -e "$f"/nocreate || {
 +	test -d /dev/cpuset/"$cpuset" || mkdir /dev/cpuset/"$cpuset"
 +	for i in cpus mems cpu_exclusive mem_exclusive; do
-+	    test -e "$f"/"$i" && cat "$f"/"$i" > /dev/cpuset/"$cpuset"/"$i"
++	    if test -e "$f"/"$i"; then
++		read v < "$f"/"$i"
++		echo $v >/dev/cpuset/"$cpuset"/"$i" || {
++		    rmdir /dev/cpuset/"$cpuset"
++		    break
++		}
 +	done
 +    }
 +
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/util-vserver-cpuset.patch?r1=1.4&r2=1.5&f=u




More information about the pld-cvs-commit mailing list