def op_pincpu(self, _, req): fn = FormFn(self.xd.domain_pincpu, [['dom', 'int'], ['vcpu', 'int'], ['cpumap', 'str']]) val = fn(req.args, {'dom': self.dom.domid}) return val
def op_cpu_sedf_set(self, _, req): fn = FormFn( self.xd.domain_cpu_sedf_set, [['dom', 'int'], ['period', 'int'], ['slice', 'int'], ['latency', 'int'], ['extratime', 'int'], ['weight', 'int']]) val = fn(req.args, {'dom': self.dom.domid}) return val
def op_vif_limit_set(self, _, req): fn = FormFn(self.xd.domain_vif_limit_set, [['dom', 'int'], ['vif', 'int'], ['credit', 'int'], ['period', 'int']]) val = fn(req.args, {'dom': self.dom.domid}) return val
def do_migrate(self, _, req): fn = FormFn(self.xd.domain_migrate, [['dom', 'int'], ['destination', 'str'], ['live', 'int'], ['resource', 'int'], ['port', 'int']]) return fn(req.args, {'dom': self.dom.domid})
def op_configure(self, _, req): """Configure an existing domain. Configure is unusual in that it requires a domain id, not a domain name. """ fn = FormFn(self.xd.domain_configure, [['dom', 'int'], ['config', 'sxpr']]) return fn(req.args, {'dom': self.dom.domid})
def op_cpu_bvt_set(self, _, req): fn = FormFn(self.xd.domain_cpu_bvt_set, [['dom', 'int'], ['mcuadv', 'int'], ['warpback', 'int'], ['warpvalue', 'int'], ['warpl', 'long'], ['warpu', 'long']]) val = fn(req.args, {'dom': self.dom.domid}) return val
def do_restore(self, _, req): fn = FormFn(self.xd.domain_restore, [['file', 'str']]) dominfo = fn(req.args) dom = dominfo.getName() domurl = "%s/%s" % (req.prePathURL(), dom) req.setResponseCode(http.CREATED) req.setHeader("Location", domurl) if self.use_sxp(req): return dominfo.sxpr() else: out = StringIO() print >> out, ('<p> Created <a href="%s">Domain %s</a></p>' % (domurl, dom)) val = out.getvalue() out.close() return val
def call(self, fn, args, req): return FormFn(fn, args)(req.args)
def op_domain_sched_credit_set(self, _, req): fn = FormFn(self.xd.domain_sched_credit_set, [['dom', 'str'], ['weight', 'int'], ['cap', 'int']]) val = fn(req.args, {'dom': self.dom.getName()}) return val
def op_cpu_sedf_get(self, _, req): fn = FormFn(self.xd.domain_cpu_sedf_get, [['dom', 'int']]) val = fn(req.args, {'dom': self.dom.domid}) return val
def do_migrate(self, _, req): fn = FormFn(self.xd.domain_migrate, [['dom', 'int'], ['destination', 'str'], ['live', 'int'], ['port', 'int'], ['node', 'int'], ['ssl', 'int'], ['change_home_server', 'bool']]) return fn(req.args, {'dom': self.dom.domid})
def do_dump(self, _, req): fn = FormFn(self.xd.domain_dump, [['dom', 'int'], ['file', 'str'], ['live', 'int'], ['crash', 'int'], ['reset', 'int']]) return fn(req.args, {'dom': self.dom.domid})
def op_cpu_bvt_slice_set(self, _, req): fn = FormFn(self.xn.cpu_bvt_slice_set, [['ctx_allow', 'int']]) val = fn(req.args, {}) return val
def op_maxmem_set(self, _, req): fn = FormFn(self.xd.domain_maxmem_set, [['dom', 'int'], ['memory', 'int']]) val = fn(req.args, {'dom': self.dom.domid}) return val
def op_domain_sched_credit_get(self, _, req): fn = FormFn(self.xd.domain_sched_credit_get, [['dom', 'int']]) val = fn(req.args, {'dom': self.dom.domid}) return val
def op_domain_sched_credit2_get(self, _, req): fn = FormFn(self.xd.domain_sched_credit2_get, [['dom', 'str']]) val = fn(req.args, {'dom': self.dom.getName()}) return val
def op_create(self, op, req): fn = FormFn(self.xvnet.vnet_create, [['config', 'sxpr']]) val = fn(req.args, {}) return val