aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorEwan Mellor <ewan@xensource.com>2007-03-18 12:06:01 +0000
committerEwan Mellor <ewan@xensource.com>2007-03-18 12:06:01 +0000
commit734d12f3111dc2184ef801a27f5bf7b5d9dd2b96 (patch)
tree152c4f5f6f0e32002274a3e64252d591b8ad98fc /tools
parent61fd72f74805924868e7f6e99c699fa43fd397a9 (diff)
downloadxen-734d12f3111dc2184ef801a27f5bf7b5d9dd2b96.tar.gz
xen-734d12f3111dc2184ef801a27f5bf7b5d9dd2b96.tar.bz2
xen-734d12f3111dc2184ef801a27f5bf7b5d9dd2b96.zip
Fix the signedness of a number of values demarshalled by xc.domain_getinfo,
in particular mem_kb and maxmem_kb. Signed-off-by: Ewan Mellor <ewan@xensource.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/python/xen/lowlevel/xc/xc.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index 804adc3104..3cb5c213ac 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -311,23 +311,25 @@ static PyObject *pyxc_domain_getinfo(XcObject *self,
PyObject *pyhandle = PyList_New(sizeof(xen_domain_handle_t));
for ( j = 0; j < sizeof(xen_domain_handle_t); j++ )
PyList_SetItem(pyhandle, j, PyInt_FromLong(info[i].handle[j]));
- info_dict = Py_BuildValue("{s:i,s:i,s:i,s:i,s:i,s:i,s:i,s:i,s:i,s:i"
- ",s:l,s:L,s:l,s:i,s:i}",
- "domid", info[i].domid,
- "online_vcpus", info[i].nr_online_vcpus,
- "max_vcpu_id", info[i].max_vcpu_id,
- "hvm", info[i].hvm,
- "dying", info[i].dying,
- "crashed", info[i].crashed,
- "shutdown", info[i].shutdown,
- "paused", info[i].paused,
- "blocked", info[i].blocked,
- "running", info[i].running,
- "mem_kb", info[i].nr_pages*(XC_PAGE_SIZE/1024),
- "cpu_time", info[i].cpu_time,
- "maxmem_kb", info[i].max_memkb,
- "ssidref", info[i].ssidref,
- "shutdown_reason", info[i].shutdown_reason);
+ info_dict = Py_BuildValue(
+ "{s:i,s:I,s:I,s:i,s:i,s:i,s:i,s:i,s:i,s:i"
+ ",s:k,s:L,s:k,s:i,s:I}",
+ "domid", (int)info[i].domid,
+ "online_vcpus", info[i].nr_online_vcpus,
+ "max_vcpu_id", info[i].max_vcpu_id,
+ "hvm", info[i].hvm,
+ "dying", info[i].dying,
+ "crashed", info[i].crashed,
+ "shutdown", info[i].shutdown,
+ "paused", info[i].paused,
+ "blocked", info[i].blocked,
+ "running", info[i].running,
+
+ "mem_kb", info[i].nr_pages*(XC_PAGE_SIZE/1024),
+ "cpu_time", (long long)info[i].cpu_time,
+ "maxmem_kb", info[i].max_memkb,
+ "ssidref", (int)info[i].ssidref,
+ "shutdown_reason", info[i].shutdown_reason);
PyDict_SetItemString(info_dict, "handle", pyhandle);
Py_DECREF(pyhandle);
PyList_SetItem(list, i, info_dict);