return (rc == 0) ? domctl.u.shadow_op.pages : rc;
}
-int xc_domain_setcpuweight(int xc_handle,
- uint32_t domid,
- float weight)
-{
- int sched_id;
- int ret;
-
- /* Figure out which scheduler is currently used: */
- if ( (ret = xc_sched_id(xc_handle, &sched_id)) != 0 )
- return ret;
-
- /* No-op. */
- return 0;
-}
-
int xc_domain_setmaxmem(int xc_handle,
uint32_t domid,
unsigned int max_memkb)
return zero;
}
-static PyObject *pyxc_domain_setcpuweight(XcObject *self,
- PyObject *args,
- PyObject *kwds)
-{
- uint32_t dom;
- float cpuweight = 1;
-
- static char *kwd_list[] = { "domid", "cpuweight", NULL };
-
- if ( !PyArg_ParseTupleAndKeywords(args, kwds, "i|f", kwd_list,
- &dom, &cpuweight) )
- return NULL;
-
- if ( xc_domain_setcpuweight(self->xc_handle, dom, cpuweight) != 0 )
- return pyxc_error_to_exception();
-
- Py_INCREF(zero);
- return zero;
-}
-
static PyObject *pyxc_domain_sethandle(XcObject *self, PyObject *args)
{
int i;
" cpumap [list, []]: list of usable CPUs.\n\n"
"Returns: [int] 0 on success; -1 on error.\n" },
- { "domain_setcpuweight",
- (PyCFunction)pyxc_domain_setcpuweight,
- METH_VARARGS | METH_KEYWORDS, "\n"
- "Set cpuweight scheduler parameter for domain.\n"
- " dom [int]: Identifier of domain to be changed.\n"
- " cpuweight [float, 1]: VCPU being pinned.\n"
- "Returns: [int] 0 on success; -1 on error.\n" },
-
{ "domain_sethandle",
(PyCFunction)pyxc_domain_sethandle,
METH_VARARGS, "\n"
self.image = image.create(self, self.info)
- xc.domain_setcpuweight(self.domid, \
- self.info['vcpus_params']['weight'])
-
# repin domain vcpus if a restricted cpus list is provided
# this is done prior to memory allocation to aide in memory
# distribution for NUMA systems.