WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] tools: Add xl python bindings for cpumap

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] tools: Add xl python bindings for cpumap
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 24 Nov 2010 10:25:21 -0800
Delivery-date: Wed, 24 Nov 2010 10:27:05 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Juergen Gross <juergen.gross@xxxxxxxxxxxxxx>
# Date 1290540909 0
# Node ID 0c2b7a185ad130060b36473ea83b7610c8fb23e0
# Parent  6557d6f2c1316157af7ea91f4615ac97307f9504
tools: Add xl python bindings for cpumap

Signed-off-by: juergen.gross@xxxxxxxxxxxxxx
---
 tools/python/xen/lowlevel/xl/xl.c |   23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)

diff -r 6557d6f2c131 -r 0c2b7a185ad1 tools/python/xen/lowlevel/xl/xl.c
--- a/tools/python/xen/lowlevel/xl/xl.c Tue Nov 23 19:33:30 2010 +0000
+++ b/tools/python/xen/lowlevel/xl/xl.c Tue Nov 23 19:35:09 2010 +0000
@@ -214,7 +214,14 @@ int attrib__libxl_cpuid_policy_list_set(
 
 int attrib__libxl_cpumap_set(PyObject *v, libxl_cpumap *pptr)
 {
-    return -1;
+    int i;
+    long cpu;
+
+    for (i = 0; i < PyList_Size(v); i++) {
+        cpu = PyInt_AsLong(PyList_GetItem(v, i));
+        libxl_cpumap_set(pptr, cpu);
+    }
+    return 0;
 }
 
 int attrib__libxl_domain_build_state_ptr_set(PyObject *v, 
libxl_domain_build_state **pptr)
@@ -264,7 +271,19 @@ PyObject *attrib__libxl_cpuid_policy_lis
 
 PyObject *attrib__libxl_cpumap_get(libxl_cpumap *pptr)
 {
-    return NULL;
+    PyObject *cpulist = NULL;
+    int i;
+
+    cpulist = PyList_New(0);
+    libxl_for_each_cpu(i, *pptr) {
+        if ( libxl_cpumap_test(pptr, i) ) {
+            PyObject* pyint = PyInt_FromLong(i);
+
+            PyList_Append(cpulist, pyint);
+            Py_DECREF(pyint);
+        }
+    }
+    return cpulist;
 }
 
 PyObject *attrib__libxl_domain_build_state_ptr_get(libxl_domain_build_state 
**pptr)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] tools: Add xl python bindings for cpumap, Xen patchbot-unstable <=