bitkeeper revision 1.1159.15.1 (4118eb0dXk4yJUHKqaxLdR-bj_e6Zg)

The weight of domains created with xm created can be specified with "weight=x" command line option, or put into the config file. Specific scheduler is responsible for handling this additional information. RRobin and Atropos ignore the argument.
This commit is contained in:
gm281@boulderdash.cl.cam.ac.uk committed 2004-08-10 15:34:37 +00:00
1 parent 75c7e9b523
commit a80edc3e70
19 files changed
+63 -31

No files matched your search

+8 -5
View File
@@ -44,16 +44,19 @@ static PyObject *pyxc_domain_create(PyObject *self,
unsigned int mem_kb = 0;
char *name = "(anon)";
int cpu = -1;
float weight;
u32 dom = 0;
int ret;
static char *kwd_list[] = { "dom", "mem_kb", "name", "cpu", NULL };
static char *kwd_list[] = { "dom", "mem_kb", "name", "cpu", "weight",
NULL };
if ( !PyArg_ParseTupleAndKeywords(args, kwds, "|iisi", kwd_list,
&dom, &mem_kb, &name, &cpu) )
if ( !PyArg_ParseTupleAndKeywords(args, kwds, "|iisif", kwd_list,
&dom, &mem_kb, &name, &cpu, &weight) )
return NULL;
if ( (ret = xc_domain_create(xc->xc_handle, mem_kb, name, cpu, &dom)) < 0 )
if ( (ret = xc_domain_create(xc->xc_handle, mem_kb, name, cpu,
weight, &dom)) < 0 )
return PyErr_SetFromErrno(xc_error);
return PyInt_FromLong(dom);
+4 -1
View File
@@ -477,6 +477,7 @@ class XendDomainInfo:
self.config = config
try:
self.name = sxp.child_value(config, 'name')
self.weight = float(sxp.child_value(config, 'weight'))
self.check_name(self.name)
self.memory = int(sxp.child_value(config, 'memory'))
if self.memory is None:
@@ -687,9 +688,10 @@ class XendDomainInfo:
if self.recreate: return
memory = self.memory
name = self.name
weight = self.weight
cpu = int(sxp.child_value(self.config, 'cpu', '-1'))
dom = self.dom or 0
dom = xc.domain_create(dom= dom, mem_kb= memory * 1024, name= name, cpu= cpu)
dom = xc.domain_create(dom= dom, mem_kb= memory * 1024, name= name, cpu= cpu, weight= weight)
if dom <= 0:
raise VmError('Creating domain failed: name=%s memory=%d'
% (name, memory))
@@ -1125,6 +1127,7 @@ add_device_handler('pci', vm_dev_pci)
add_config_handler('name', vm_field_ignore)
add_config_handler('memory', vm_field_ignore)
add_config_handler('cpu', vm_field_ignore)
add_config_handler('weight', vm_field_ignore)
add_config_handler('console', vm_field_ignore)
add_config_handler('image', vm_field_ignore)
add_config_handler('device', vm_field_ignore)
+6 -1
View File
@@ -97,6 +97,10 @@ gopts.var('memory', val='MEMORY',
fn=set_value, default=128,
use="Domain memory in MB.")
gopts.var('weight', val='WEIGHT',
fn=set_value, default=1,
use="Domain cpu weight (default=1).")
gopts.var('console', val='PORT',
fn=set_int, default=None,
use="Console port to use. Default is 9600 + domain id.")
@@ -295,7 +299,8 @@ def make_config(vals):
config = ['vm',
['name', vals.name ],
['memory', vals.memory ] ]
['memory', vals.memory ],
['weight', vals.weight] ]
if vals.cpu:
config.append(['cpu', vals.cpu])
if vals.blkif:
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.