remove extra field from vcpuinfo python binding
PATCH 1/1 remove extra field from vcpuinfo python binding
There are only six fields in vcpuinfo, also cpumap_t is a u64, so use [1]"K" for parsing cpumap.
1. http://www.python.org/doc/2.4.1/api/arg-parsing.html
Signature · 25 lines
Ryan Harper Software Engineer; Linux Technology Center IBM Corp., Austin, Tx (512) 838-9253 T/L: 678-9253 [email protected] diffstat output: xc.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Signed-off-by: Ryan Harper <[email protected]> --- diff -r 446aa56ca4fe tools/python/xen/lowlevel/xc/xc.c --- a/tools/python/xen/lowlevel/xc/xc.c Mon Oct 17 12:50:28 2005 +++ b/tools/python/xen/lowlevel/xc/xc.c Mon Oct 17 18:00:31 2005 @@ -365,7 +365,7 @@ if ( rc < 0 ) return PyErr_SetFromErrno(xc_error); - info_dict = Py_BuildValue("{s:i,s:i,s:i,s:L,s:i,s:i,s:i}", + info_dict = Py_BuildValue("{s:i,s:i,s:i,s:L,s:i,s:K}", "online", info.online, "blocked", info.blocked, "running", info.running,
Quoted 4 lines · Ryan Harper
There are only six fields in vcpuinfo, also
cpumap_tis a u64, so use [1]"K" for parsing cpumap.
I won't change to 'K' because that is not supported by Python 2.2, and also because it leaves the cpumap argument to domain_pincpu() as an 'i'.
Furthermore, I disagree with exporting cpu bitmaps into Python. I think it would be much nicer to pass lists of cpus (i.e., lists of ints) to and fro at that interface, and have xc.c do the conversion between lists and bitmaps. I would gladly take a patch that implements this.
-- Keir