[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] libxl: drop libxl_cpuarray -- topology was the only user.



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1328027679 0
# Node ID 8eedc39f60e36779ad6885a7622bf16252113c39
# Parent  1d8f40029ddb87c511d0237ab7ae9d4d117ea6cf
libxl: drop libxl_cpuarray -- topology was the only user.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---


diff -r 1d8f40029ddb -r 8eedc39f60e3 tools/libxl/gentest.py
--- a/tools/libxl/gentest.py    Tue Jan 31 16:34:39 2012 +0000
+++ b/tools/libxl/gentest.py    Tue Jan 31 16:34:39 2012 +0000
@@ -21,7 +21,7 @@
 
 handcoded = ["libxl_cpumap", "libxl_key_value_list",
              "libxl_cpuid_policy_list", "libxl_file_reference",
-             "libxl_string_list", "libxl_cpuarray"]
+             "libxl_string_list"]
 
 def gen_rand_init(ty, v, indent = "    ", parent = None):
     s = ""
@@ -194,23 +194,6 @@
     l[i] = NULL;
     *p = l;
 }
-
-#if 0 /* To be remove in a subsequent patch */
-static void libxl_cpuarray_rand_init(libxl_cpuarray *p)
-{
-    int i;
-    /* Up to 16 VCPUs on 32 PCPUS */
-    p->entries = rand() % 16;
-    p->array = calloc(p->entries, sizeof(*p->array));
-    for (i = 0; i < p->entries; i++) {
-        int r = rand() % 32*1.5; /* 2:1 valid:invalid */
-        if (r >= 32)
-            p->array[i] = LIBXL_CPUARRAY_INVALID_ENTRY;
-        else
-            p->array[i] = r;
-    }
-}
-#endif
 """)
     for ty in builtins + types:
         if ty.typename not in handcoded:
diff -r 1d8f40029ddb -r 8eedc39f60e3 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h       Tue Jan 31 16:34:39 2012 +0000
+++ b/tools/libxl/libxl.h       Tue Jan 31 16:34:39 2012 +0000
@@ -164,13 +164,6 @@
 void libxl_cpumap_dispose(libxl_cpumap *map);
 
 typedef struct {
-    uint32_t entries;
-    uint32_t *array;
-} libxl_cpuarray;
-#define LIBXL_CPUARRAY_INVALID_ENTRY  ~0
-void libxl_cpuarray_dispose(libxl_cpuarray *array);
-
-typedef struct {
     /*
      * Path is always set if the file reference is valid. However if
      * mapped is true then the actual file may already be unlinked.
diff -r 1d8f40029ddb -r 8eedc39f60e3 tools/libxl/libxl_json.c
--- a/tools/libxl/libxl_json.c  Tue Jan 31 16:34:39 2012 +0000
+++ b/tools/libxl/libxl_json.c  Tue Jan 31 16:34:39 2012 +0000
@@ -246,27 +246,6 @@
     return s;
 }
 
-yajl_gen_status libxl_cpuarray_gen_json(yajl_gen hand,
-                                        libxl_cpuarray *cpuarray)
-{
-    yajl_gen_status s;
-    int i;
-
-    s = yajl_gen_array_open(hand);
-    if (s != yajl_gen_status_ok) goto out;
-
-    for(i=0; i<cpuarray->entries; i++) {
-        if (cpuarray->array[i] == LIBXL_CPUARRAY_INVALID_ENTRY)
-            s = yajl_gen_null(hand);
-        else
-            s = yajl_gen_integer(hand, cpuarray->array[i]);
-        if (s != yajl_gen_status_ok) goto out;
-    }
-    s = yajl_gen_array_close(hand);
-out:
-    return s;
-}
-
 yajl_gen_status libxl_file_reference_gen_json(yajl_gen hand,
                                               libxl_file_reference *p)
 {
diff -r 1d8f40029ddb -r 8eedc39f60e3 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl       Tue Jan 31 16:34:39 2012 +0000
+++ b/tools/libxl/libxl_types.idl       Tue Jan 31 16:34:39 2012 +0000
@@ -9,7 +9,6 @@
 libxl_uuid = Builtin("uuid", passby=PASS_BY_REFERENCE)
 libxl_mac = Builtin("mac", passby=PASS_BY_REFERENCE)
 libxl_cpumap = Builtin("cpumap", dispose_fn="libxl_cpumap_dispose", 
passby=PASS_BY_REFERENCE)
-libxl_cpuarray = Builtin("cpuarray", dispose_fn="libxl_cpuarray_dispose", 
passby=PASS_BY_REFERENCE)
 libxl_cpuid_policy_list = Builtin("cpuid_policy_list", 
dispose_fn="libxl_cpuid_dispose", passby=PASS_BY_REFERENCE)
 
 libxl_string_list = Builtin("string_list", 
dispose_fn="libxl_string_list_dispose", passby=PASS_BY_REFERENCE)
diff -r 1d8f40029ddb -r 8eedc39f60e3 tools/libxl/libxl_utils.c
--- a/tools/libxl/libxl_utils.c Tue Jan 31 16:34:39 2012 +0000
+++ b/tools/libxl/libxl_utils.c Tue Jan 31 16:34:39 2012 +0000
@@ -514,30 +514,6 @@
     cpumap->map[cpu / 8] &= ~(1 << (cpu & 7));
 }
 
-int libxl_cpuarray_alloc(libxl_ctx *ctx, libxl_cpuarray *cpuarray)
-{
-    int max_cpus;
-    int i;
-
-    max_cpus = libxl_get_max_cpus(ctx);
-    if (max_cpus == 0)
-        return ERROR_FAIL;
-
-    cpuarray->array = calloc(max_cpus, sizeof(*cpuarray->array));
-    if (!cpuarray->array)
-        return ERROR_NOMEM;
-    cpuarray->entries = max_cpus;
-    for (i = 0; i < max_cpus; i++)
-        cpuarray->array[i] = LIBXL_CPUARRAY_INVALID_ENTRY;
-
-    return 0;
-}
-
-void libxl_cpuarray_dispose(libxl_cpuarray *array)
-{
-    free(array->array);
-}
-
 int libxl_get_max_cpus(libxl_ctx *ctx)
 {
     return xc_get_max_cpus(ctx->xch);
diff -r 1d8f40029ddb -r 8eedc39f60e3 tools/libxl/libxl_utils.h
--- a/tools/libxl/libxl_utils.h Tue Jan 31 16:34:39 2012 +0000
+++ b/tools/libxl/libxl_utils.h Tue Jan 31 16:34:39 2012 +0000
@@ -86,8 +86,6 @@
 #define libxl_for_each_set_cpu(v, m) for (v = 0; v < (m).size * 8; v++) \
                                              if (libxl_cpumap_test(&(m), v))
 
-int libxl_cpuarray_alloc(libxl_ctx *ctx, libxl_cpuarray *cpuarray);
-
 static inline uint32_t libxl__sizekb_to_mb(uint32_t s) {
     return (s + 1023) / 1024;
 }
diff -r 1d8f40029ddb -r 8eedc39f60e3 tools/python/xen/lowlevel/xl/xl.c
--- a/tools/python/xen/lowlevel/xl/xl.c Tue Jan 31 16:34:39 2012 +0000
+++ b/tools/python/xen/lowlevel/xl/xl.c Tue Jan 31 16:34:39 2012 +0000
@@ -227,11 +227,6 @@
     return 0;
 }
 
-int attrib__libxl_cpuarray_set(PyObject *v, libxl_cpuarray *pptr)
-{
-    return -1;
-}
-
 int attrib__libxl_file_reference_set(PyObject *v, libxl_file_reference *pptr)
 {
     return genwrap__string_set(v, &pptr->path);
@@ -304,25 +299,6 @@
     return cpulist;
 }
 
-PyObject *attrib__libxl_cpuarray_get(libxl_cpuarray *pptr)
-{
-    PyObject *list = NULL;
-    int i;
-
-    list = PyList_New(0);
-    for (i = 0; i < pptr->entries; i++) {
-        if (pptr->array[i] == LIBXL_CPUARRAY_INVALID_ENTRY) {
-            PyList_Append(list, Py_None);
-        } else {
-            PyObject* pyint = PyInt_FromLong(pptr->array[i]);
-
-            PyList_Append(list, pyint);
-            Py_DECREF(pyint);
-        }
-    }
-    return list;
-}
-
 PyObject *attrib__libxl_file_reference_get(libxl_file_reference *pptr)
 {
     return genwrap__string_get(&pptr->path);

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.