+ try:
+ vserverimpl.setsched(self.ctx,fillrate,interval,tokens,tokensmin,tokensmax,cpuguaranteed)
+ except OSError, ex:
+ if ex.errno == 22:
+ print "kernel does not support vserver scheduler"
+ else:
+ raise ex
+
+ def get_sched(self):
+ # have no way of querying scheduler right now on a per vserver basis
+ return (-1, False)
+
+ def set_memlimit(self, limit):
+ ret = vserverimpl.setrlimit(self.ctx,5,limit)
+ return ret
+
+ def get_memlimit(self):
+ ret = vserverimpl.getrlimit(self.ctx,5)
+ return ret
+
+ def set_tasklimit(self, limit):
+ ret = vserverimpl.setrlimit(self.ctx,6,limit)
+ return ret
+
+ def get_tasklimit(self):
+ ret = vserverimpl.getrlimit(self.ctx,6)
+ return ret
+
+ def set_bwlimit(self, eth, limit, cap, minrate, maxrate):
+ if cap == "-1":
+ bwlimit.off(self.ctx,eth)
+ else:
+ bwlimit.on(self.ctx, eth, limit, cap, minrate, maxrate)
+
+ def get_bwlimit(self, eth):
+ # not implemented yet
+ bwlimit = -1
+ cap = "unknown"
+ minrate = "unknown"
+ maxrate = "unknown"
+ return (bwlimit, cap, minrate, maxrate)
+