- global SCHED_TOKENS_MIN, SCHED_TOKENS_MAX
- tokensmin = SCHED_TOKENS_MIN
- tokensmax = SCHED_TOKENS_MAX
-
- if besteffort is True:
- # magic "interval" value for Andy's scheduler to denote besteffort
- interval = 1000
- fillrate = shares
- else:
- interval = 1001
- fillrate = shares
+ # for the old CKRM scheduler
+ if cpulimit.checkckrm() is True:
+ cpulimit.cpuinit()
+ cpulimit.vs2ckrm_on(self.name)
+ try:
+ cpulimit.cpulimit(self.name,shares)
+ except OSError, ex:
+ if ex.errno == 22:
+ print "invalid shares argument"
+ # should re-raise exception?!