diff -aru ../xen-2.0.7-orig/tools/libxc/xc_domain.c tools/libxc/xc_domain.c --- ../xen-2.0.7-orig/tools/libxc/xc_domain.c 2005-08-03 16:57:57.000000000 -0700 +++ tools/libxc/xc_domain.c 2005-09-22 18:18:48.000000000 -0700 @@ -12,6 +12,7 @@ unsigned int mem_kb, int cpu, float cpu_weight, + u32 tdf, u32 *pdomid) { int err; @@ -21,6 +22,7 @@ op.u.createdomain.domain = (domid_t)*pdomid; op.u.createdomain.memory_kb = mem_kb; op.u.createdomain.cpu = cpu; + op.u.createdomain.tdf = tdf; if ( (err = do_dom0_op(xc_handle, &op)) == 0 ) { diff -aru ../xen-2.0.7-orig/tools/libxc/xc.h tools/libxc/xc.h --- ../xen-2.0.7-orig/tools/libxc/xc.h 2005-08-03 16:57:57.000000000 -0700 +++ tools/libxc/xc.h 2005-09-22 18:18:48.000000000 -0700 @@ -76,6 +76,7 @@ unsigned int mem_kb, int cpu, float cpu_weight, + u32 tdf, u32 *pdomid); /** @@ -230,6 +231,8 @@ s32 *warpvalue, long long *warpl, long long *warpu); +/* DG: tdf routines */ +int xc_domain_get_tdf(int xc_handle, u32 domid, unsigned int *tdf); int xc_atropos_domain_set(int xc_handle, u32 domid, diff -aru ../xen-2.0.7-orig/tools/libxc/xc_linux_restore.c tools/libxc/xc_linux_restore.c --- ../xen-2.0.7-orig/tools/libxc/xc_linux_restore.c 2005-08-03 16:57:57.000000000 -0700 +++ tools/libxc/xc_linux_restore.c 2005-09-22 18:18:48.000000000 -0700 @@ -187,8 +187,9 @@ } /* Create domain on CPU -1 so that it may auto load-balance in future. */ + /* DG: accomodate new TDF param */ if ( xc_domain_create(xc_handle, nr_pfns * (PAGE_SIZE / 1024), - -1, 1, &dom) ) + -1, 1, 1, &dom) ) { xcio_error(ioctxt, "Could not create domain. pfns=%d, %dKB", nr_pfns,nr_pfns * (PAGE_SIZE / 1024)); diff -aru ../xen-2.0.7-orig/tools/python/xen/lowlevel/xc/xc.c tools/python/xen/lowlevel/xc/xc.c --- ../xen-2.0.7-orig/tools/python/xen/lowlevel/xc/xc.c 2005-08-03 16:57:58.000000000 -0700 +++ tools/python/xen/lowlevel/xc/xc.c 2005-09-22 18:18:48.000000000 -0700 @@ -45,16 +45,19 @@ int cpu = -1; float cpu_weight = 1; u32 dom = 0; + u32 tdf; int ret; - static char *kwd_list[] = { "dom", "mem_kb", "cpu", "cpu_weight", NULL }; + /*static char *kwd_list[] = { "dom", "mem_kb", "cpu", "cpu_weight", NULL };*/ + static char *kwd_list[] = { "dom", "mem_kb", "cpu", "cpu_weight", "tdf", NULL }; - if ( !PyArg_ParseTupleAndKeywords(args, kwds, "|iiif", kwd_list, - &dom, &mem_kb, &cpu, &cpu_weight)) + /*if ( !PyArg_ParseTupleAndKeywords(args, kwds, "|iiif", kwd_list, */ + if ( !PyArg_ParseTupleAndKeywords(args, kwds, "|iiifi", kwd_list, + &dom, &mem_kb, &cpu, &cpu_weight, &tdf)) return NULL; if ( (ret = xc_domain_create( - xc->xc_handle, mem_kb, cpu, cpu_weight, &dom)) < 0 ) + xc->xc_handle, mem_kb, cpu, cpu_weight, tdf, &dom)) < 0 ) return PyErr_SetFromErrno(xc_error); return PyInt_FromLong(dom); diff -aru ../xen-2.0.7-orig/tools/python/xen/xend/XendDomainInfo.py tools/python/xen/xend/XendDomainInfo.py --- ../xen-2.0.7-orig/tools/python/xen/xend/XendDomainInfo.py 2005-08-03 16:57:58.000000000 -0700 +++ tools/python/xen/xend/XendDomainInfo.py 2005-09-23 11:29:56.000000000 -0700 @@ -712,8 +712,16 @@ except: raise VmError('invalid cpu') cpu_weight = self.cpu_weight + + # DG: tdf + try: + tdf = int(sxp.child_value(self.config, 'tdf', '1')) + except: + raise VmError('invalid tdf') + dom = xc.domain_create(dom= dom, mem_kb= memory * 1024, - cpu= cpu, cpu_weight= cpu_weight) + cpu= cpu, cpu_weight= cpu_weight, tdf=tdf) + if dom <= 0: raise VmError('Creating domain failed: name=%s memory=%d' % (name, memory)) diff -aru ../xen-2.0.7-orig/tools/python/xen/xm/create.py tools/python/xen/xm/create.py --- ../xen-2.0.7-orig/tools/python/xen/xm/create.py 2005-08-03 16:57:58.000000000 -0700 +++ tools/python/xen/xm/create.py 2005-09-23 11:11:19.000000000 -0700 @@ -110,6 +110,11 @@ fn=set_int, default=128, use="Domain memory in MB.") +# DG: tdf +gopts.var('tdf', val='TDF', + fn=set_int, default=1, + use="Time dilation factor") + gopts.var('maxmem', val='MEMORY', fn=set_int, default=None, use="Maximum domain memory in MB.") @@ -352,6 +357,9 @@ config.append(['restart', vals.restart]) if vals.console: config.append(['console', vals.console]) + # DG: tdf + if vals.tdf: + config.append(['tdf', vals.tdf]) configure_image(config, vals) config_devs = []