direct-io.hg

changeset 14429:2b58c9e32549

xend: Avoid use of 'k' specifier to Py_BuildValue(). Its
implementation is broken until Python v2.4.3. Instead cast the C value
to long long and use the 'L' specifier.
Signed-off-by: Keir Fraser <keir@xensource.com>
author Keir Fraser <keir@xensource.com>
date Sun Mar 18 18:26:34 2007 +0000 (2007-03-18)
parents 7521c87983e0
children 548e61fbdc1a
files tools/python/xen/lowlevel/xc/xc.c
line diff
     1.1 --- a/tools/python/xen/lowlevel/xc/xc.c	Sun Mar 18 16:49:52 2007 +0000
     1.2 +++ b/tools/python/xen/lowlevel/xc/xc.c	Sun Mar 18 18:26:34 2007 +0000
     1.3 @@ -314,7 +314,7 @@ static PyObject *pyxc_domain_getinfo(XcO
     1.4      {
     1.5          info_dict = Py_BuildValue(
     1.6              "{s:i,s:i,s:i,s:i,s:i,s:i,s:i,s:i,s:i,s:i"
     1.7 -            ",s:k,s:L,s:k,s:i,s:i}",
     1.8 +            ",s:L,s:L,s:L,s:i,s:i}",
     1.9              "domid",           (int)info[i].domid,
    1.10              "online_vcpus",    info[i].nr_online_vcpus,
    1.11              "max_vcpu_id",     info[i].max_vcpu_id,
    1.12 @@ -325,9 +325,9 @@ static PyObject *pyxc_domain_getinfo(XcO
    1.13              "paused",          info[i].paused,
    1.14              "blocked",         info[i].blocked,
    1.15              "running",         info[i].running,
    1.16 -            "mem_kb",          info[i].nr_pages*(XC_PAGE_SIZE/1024),
    1.17 +            "mem_kb",          (long long)info[i].nr_pages*(XC_PAGE_SIZE/1024),
    1.18              "cpu_time",        (long long)info[i].cpu_time,
    1.19 -            "maxmem_kb",       info[i].max_memkb,
    1.20 +            "maxmem_kb",       (long long)info[i].max_memkb,
    1.21              "ssidref",         (int)info[i].ssidref,
    1.22              "shutdown_reason", info[i].shutdown_reason);
    1.23          pyhandle = PyList_New(sizeof(xen_domain_handle_t));