direct-io.hg

changeset 14426:afbf744440d2

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>
author Ewan Mellor <ewan@xensource.com>
date Sun Mar 18 12:06:01 2007 +0000 (2007-03-18)
parents 6b2875302558
children 9df276596cbb
files tools/python/xen/lowlevel/xc/xc.c
line diff
     1.1 --- a/tools/python/xen/lowlevel/xc/xc.c	Sat Mar 17 23:59:05 2007 +0000
     1.2 +++ b/tools/python/xen/lowlevel/xc/xc.c	Sun Mar 18 12:06:01 2007 +0000
     1.3 @@ -311,23 +311,25 @@ static PyObject *pyxc_domain_getinfo(XcO
     1.4          PyObject *pyhandle = PyList_New(sizeof(xen_domain_handle_t));
     1.5          for ( j = 0; j < sizeof(xen_domain_handle_t); j++ )
     1.6              PyList_SetItem(pyhandle, j, PyInt_FromLong(info[i].handle[j]));
     1.7 -        info_dict = Py_BuildValue("{s:i,s:i,s:i,s:i,s:i,s:i,s:i,s:i,s:i,s:i"
     1.8 -                                  ",s:l,s:L,s:l,s:i,s:i}",
     1.9 -                                  "domid",       info[i].domid,
    1.10 -                                  "online_vcpus", info[i].nr_online_vcpus,
    1.11 -                                  "max_vcpu_id", info[i].max_vcpu_id,
    1.12 -                                  "hvm",       info[i].hvm,
    1.13 -                                  "dying",     info[i].dying,
    1.14 -                                  "crashed",   info[i].crashed,
    1.15 -                                  "shutdown",  info[i].shutdown,
    1.16 -                                  "paused",    info[i].paused,
    1.17 -                                  "blocked",   info[i].blocked,
    1.18 -                                  "running",   info[i].running,
    1.19 -                                  "mem_kb",    info[i].nr_pages*(XC_PAGE_SIZE/1024),
    1.20 -                                  "cpu_time",  info[i].cpu_time,
    1.21 -                                  "maxmem_kb", info[i].max_memkb,
    1.22 -                                  "ssidref",   info[i].ssidref,
    1.23 -                                  "shutdown_reason", info[i].shutdown_reason);
    1.24 +        info_dict = Py_BuildValue(
    1.25 +            "{s:i,s:I,s:I,s:i,s:i,s:i,s:i,s:i,s:i,s:i"
    1.26 +            ",s:k,s:L,s:k,s:i,s:I}",
    1.27 +            "domid",           (int)info[i].domid,
    1.28 +            "online_vcpus",    info[i].nr_online_vcpus,
    1.29 +            "max_vcpu_id",     info[i].max_vcpu_id,
    1.30 +            "hvm",             info[i].hvm,
    1.31 +            "dying",           info[i].dying,
    1.32 +            "crashed",         info[i].crashed,
    1.33 +            "shutdown",        info[i].shutdown,
    1.34 +            "paused",          info[i].paused,
    1.35 +            "blocked",         info[i].blocked,
    1.36 +            "running",         info[i].running,
    1.37 +            
    1.38 +            "mem_kb",          info[i].nr_pages*(XC_PAGE_SIZE/1024),
    1.39 +            "cpu_time",        (long long)info[i].cpu_time,
    1.40 +            "maxmem_kb",       info[i].max_memkb,
    1.41 +            "ssidref",         (int)info[i].ssidref,
    1.42 +            "shutdown_reason", info[i].shutdown_reason);
    1.43          PyDict_SetItemString(info_dict, "handle", pyhandle);
    1.44          Py_DECREF(pyhandle);
    1.45          PyList_SetItem(list, i, info_dict);