def __do_chroot(self):
- return os.chroot("%s/%s" % (__DEFAULT_VSERVERDIR, self.name))
+ return os.chroot("%s/%s" % (DEFAULT_VSERVERDIR, self.name))
def set_disklimit(self, blocktotal):
- path = "%s/%s" % (__DEFAULT_VSERVERDIR, self.name)
+ path = "%s/%s" % (DEFAULT_VSERVERDIR, self.name)
inodes, blockcount, size = vduimpl.vdu(path)
blockcount = blockcount >> 1
print "block limit (%d) ignored for vserver %s" %(blocktotal,self.name)
def get_disklimit(self):
- path = "%s/%s" % (__DEFAULT_VSERVERDIR, self.name)
+ path = "%s/%s" % (DEFAULT_VSERVERDIR, self.name)
try:
blocksused, blocktotal, inodesused, inodestotal, reserved = \
vserverimpl.getdlimit(path,self.ctx)
fillrate = shares
try:
- vserverimpl.setsched(self.ctx,fillrate,interval,tokensmin,tokensmax)
+ cpuguaranteed = 0 # need to set this from the conf file
+ vserverimpl.setsched(self.ctx,fillrate,interval,tokensmin,tokensmax,cpuguaranteed)
except OSError, ex:
if ex.errno == 22:
print "kernel does not support vserver scheduler"
def __do_chcontext(self, state_file = None):
- vserverimpl.chcontext(self.ctx, self.remove_caps)
+ vserverimpl.chcontext(self.ctx)
if not state_file:
return
print >>state_file, "S_CONTEXT=%d" % self.ctx