git://git.onelab.eu
/
util-vserver-pl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7ffbad8
)
fix setting cpu_share for slices
author
S.Çağlar Onur
<caglar@cs.princeton.edu>
Tue, 6 Jul 2010 19:37:04 +0000
(19:37 +0000)
committer
S.Çağlar Onur
<caglar@cs.princeton.edu>
Tue, 6 Jul 2010 19:37:04 +0000
(19:37 +0000)
python/vserver.py
patch
|
blob
|
history
diff --git
a/python/vserver.py
b/python/vserver.py
index
315edbb
..
796b012
100644
(file)
--- a/
python/vserver.py
+++ b/
python/vserver.py
@@
-327,7
+327,7
@@
class VServer:
def set_sched_config(self, cpu_min, cpu_share):
""" Write current CPU scheduler parameters to the vserver
configuration file. Currently, 'cpu_min' is not supported. """
def set_sched_config(self, cpu_min, cpu_share):
""" Write current CPU scheduler parameters to the vserver
configuration file. Currently, 'cpu_min' is not supported. """
- self.config.update('cgroup/cpu.shares',
cpu_share
* CPU_SHARE_MULT)
+ self.config.update('cgroup/cpu.shares',
int(cpu_share)
* CPU_SHARE_MULT)
if self.is_running():
self.set_sched(cpu_min, cpu_share)
if self.is_running():
self.set_sched(cpu_min, cpu_share)
@@
-335,8
+335,8
@@
class VServer:
""" Update kernel CPU scheduling parameters for this context.
Currently, 'cpu_min' is not supported. """
try:
""" Update kernel CPU scheduling parameters for this context.
Currently, 'cpu_min' is not supported. """
try:
- cgroup = open('/dev/cgroup/%s/cpu.shares' % name, 'w')
- cgroup.write('%s' % (
cpu_share
* CPU_SHARE_MULT))
+ cgroup = open('/dev/cgroup/%s/cpu.shares' %
self.
name, 'w')
+ cgroup.write('%s' % (
int(cpu_share)
* CPU_SHARE_MULT))
cgroup.close()
except:
pass
cgroup.close()
except:
pass