bitkeeper revision 1.1159.30.1 (411ddb8cj12XLuMNx_qS9SGeej51OQ)

cpu_weight parameter added to the xm create command. Minor bug fix for BVT.
This commit is contained in:
gm281@boulderdash.cl.cam.ac.uk committed 2004-08-14 09:29:48 +00:00
1 parent dfd9f2b6cb
commit 274e01f431
7 files changed
+96 -15

No files matched your search

+7 -4
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 cpu_weight = 1;
u32 dom = 0;
int ret;
static char *kwd_list[] = { "dom", "mem_kb", "name", "cpu", NULL };
static char *kwd_list[] = { "dom", "mem_kb", "name",
"cpu", "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, &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, cpu_weight, &dom)) < 0 )
return PyErr_SetFromErrno(xc_error);
return PyInt_FromLong(dom);
+11 -8
View File
@@ -490,6 +490,7 @@ class XendDomainInfo:
try:
self.name = sxp.child_value(config, 'name')
self.check_name(self.name)
self.cpu_weight = float(sxp.child_value(config, 'cpu_weight'))
self.memory = int(sxp.child_value(config, 'memory'))
if self.memory is None:
raise VmError('missing memory size')
@@ -709,8 +710,9 @@ class XendDomainInfo:
memory = self.memory
name = self.name
cpu = int(sxp.child_value(self.config, 'cpu', '-1'))
cpu_weight = self.cpu_weight
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, cpu_weight= cpu_weight)
if dom <= 0:
raise VmError('Creating domain failed: name=%s memory=%d'
% (name, memory))
@@ -1137,12 +1139,13 @@ add_device_handler('vbd', vm_dev_vbd)
add_device_handler('pci', vm_dev_pci)
# Ignore the fields we already handle.
add_config_handler('name', vm_field_ignore)
add_config_handler('memory', vm_field_ignore)
add_config_handler('cpu', vm_field_ignore)
add_config_handler('console', vm_field_ignore)
add_config_handler('image', vm_field_ignore)
add_config_handler('device', vm_field_ignore)
add_config_handler('backend', vm_field_ignore)
add_config_handler('name', vm_field_ignore)
add_config_handler('memory', vm_field_ignore)
add_config_handler('cpu', vm_field_ignore)
add_config_handler('cpu_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)
add_config_handler('backend', vm_field_ignore)
# Register other config handlers.
+6 -1
View File
@@ -101,6 +101,10 @@ gopts.var('memory', val='MEMORY',
fn=set_value, default=128,
use="Domain memory in MB.")
gopts.var('cpu_weight', val='CPU_WEIGHT',
fn=set_value, default=1,
use="CPU weight.")
gopts.var('console', val='PORT',
fn=set_int, default=None,
use="Console port to use. Default is 9600 + domain id.")
@@ -299,7 +303,8 @@ def make_config(vals):
config = ['vm',
['name', vals.name ],
['memory', vals.memory ] ]
['memory', vals.memory ],
['cpu_weight', vals.cpu_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.