Ryan Harper
2005-Oct-17 23:08 UTC
[Xen-devel] [PATCH] 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 -- Ryan Harper Software Engineer; Linux Technology Center IBM Corp., Austin, Tx (512) 838-9253 T/L: 678-9253 ryanh@us.ibm.com diffstat output: xc.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Signed-off-by: Ryan Harper <ryanh@us.ibm.com> --- 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, _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2005-Oct-18 10:00 UTC
[Xen-devel] Re: [PATCH] remove extra field from vcpuinfo python binding
On 18 Oct 2005, at 00:08, Ryan Harper wrote:> 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.htmlI 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 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel