git://git.onelab.eu
/
util-vserver.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c6cd4c7
)
set vm_running based on is_running, always update scheduler configuration
author
Daniel Hokka Zakrisson
<dhokka@cs.princeton.edu>
Fri, 6 Jul 2007 17:39:26 +0000
(17:39 +0000)
committer
Daniel Hokka Zakrisson
<dhokka@cs.princeton.edu>
Fri, 6 Jul 2007 17:39:26 +0000
(17:39 +0000)
python/vserver.py
patch
|
blob
|
history
diff --git
a/python/vserver.py
b/python/vserver.py
index
ff87522
..
a352427
100644
(file)
--- a/
python/vserver.py
+++ b/
python/vserver.py
@@
-118,7
+118,7
@@
class VServer:
INITSCRIPTS = [('/etc/rc.vinit', 'start'),
('/etc/rc.d/rc', '%(runlevel)d')]
INITSCRIPTS = [('/etc/rc.vinit', 'start'),
('/etc/rc.d/rc', '%(runlevel)d')]
- def __init__(self, name, vm_id = None, vm_running =
Fals
e):
+ def __init__(self, name, vm_id = None, vm_running =
Non
e):
self.name = name
self.rlimits_changed = False
self.name = name
self.rlimits_changed = False
@@
-131,6
+131,8
@@
class VServer:
if vm_id == None:
vm_id = int(self.config.get('S_CONTEXT'))
self.ctx = vm_id
if vm_id == None:
vm_id = int(self.config.get('S_CONTEXT'))
self.ctx = vm_id
+ if vm_running == None:
+ vm_running = self.is_running()
self.vm_running = vm_running
def have_limits_changed(self):
self.vm_running = vm_running
def have_limits_changed(self):
@@
-267,8
+269,6
@@
class VServer:
configuration file. This method does not modify the kernel CPU
scheduling parameters for this context. """
configuration file. This method does not modify the kernel CPU
scheduling parameters for this context. """
- if cpu_share == int(self.config.get("CPULIMIT", -1)):
- return
cpu_guaranteed = sched_flags & SCHED_CPU_GUARANTEED
cpu_config = { "CPULIMIT": cpu_share, "CPUGUARANTEED": cpu_guaranteed }
self.update_resources(cpu_config)
cpu_guaranteed = sched_flags & SCHED_CPU_GUARANTEED
cpu_config = { "CPULIMIT": cpu_share, "CPUGUARANTEED": cpu_guaranteed }
self.update_resources(cpu_config)