aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Ludlam <jonathan.ludlam@eu.citrix.com>2011-10-10 16:41:17 +0100
committerJon Ludlam <jonathan.ludlam@eu.citrix.com>2011-10-10 16:41:17 +0100
commit4c86793caea3f709c6d953824a9e3b982fd9b403 (patch)
tree7dbe4211a86857fd0bf97f95cd9b88cba048f743
parent542a913b88b7be95462e0c9e5f57b744e7b8b010 (diff)
downloadxen-4c86793caea3f709c6d953824a9e3b982fd9b403.tar.gz
xen-4c86793caea3f709c6d953824a9e3b982fd9b403.tar.bz2
xen-4c86793caea3f709c6d953824a9e3b982fd9b403.zip
tools/ocaml: Small improvement to the ocaml xenctrl library
Add a new field 'max_nr_cpus' to the physinfo type in the ocaml xc bindings Signed-off-by: Zheng Li <zheng.li@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
-rw-r--r--tools/ocaml/libs/xc/xenctrl.ml1
-rw-r--r--tools/ocaml/libs/xc/xenctrl.mli1
-rw-r--r--tools/ocaml/libs/xc/xenctrl_stubs.c4
3 files changed, 5 insertions, 1 deletions
diff --git a/tools/ocaml/libs/xc/xenctrl.ml b/tools/ocaml/libs/xc/xenctrl.ml
index c02efbcc69..b7ba8b7ddc 100644
--- a/tools/ocaml/libs/xc/xenctrl.ml
+++ b/tools/ocaml/libs/xc/xenctrl.ml
@@ -70,6 +70,7 @@ type physinfo =
scrub_pages : nativeint;
(* XXX hw_cap *)
capabilities : physinfo_cap_flag list;
+ max_nr_cpus : int;
}
type version =
diff --git a/tools/ocaml/libs/xc/xenctrl.mli b/tools/ocaml/libs/xc/xenctrl.mli
index 07667848db..bc4af56a1d 100644
--- a/tools/ocaml/libs/xc/xenctrl.mli
+++ b/tools/ocaml/libs/xc/xenctrl.mli
@@ -52,6 +52,7 @@ type physinfo = {
free_pages : nativeint;
scrub_pages : nativeint;
capabilities : physinfo_cap_flag list;
+ max_nr_cpus : int; (** compile-time max possible number of nr_cpus *)
}
type version = { major : int; minor : int; extra : string; }
type compile_info = {
diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index 03923e8c6a..36b7801a3d 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -534,6 +534,7 @@ CAMLprim value stub_xc_readconsolering(value xch)
if (retval)
failwith_xc(_H(xch));
+
ring[size] = '\0';
CAMLreturn(caml_copy_string(ring));
}
@@ -573,7 +574,7 @@ CAMLprim value stub_xc_physinfo(value xch)
}
}
- physinfo = caml_alloc_tuple(9);
+ physinfo = caml_alloc_tuple(10);
Store_field(physinfo, 0, Val_int(c_physinfo.threads_per_core));
Store_field(physinfo, 1, Val_int(c_physinfo.cores_per_socket));
Store_field(physinfo, 2, Val_int(c_physinfo.nr_cpus));
@@ -583,6 +584,7 @@ CAMLprim value stub_xc_physinfo(value xch)
Store_field(physinfo, 6, caml_copy_nativeint(c_physinfo.free_pages));
Store_field(physinfo, 7, caml_copy_nativeint(c_physinfo.scrub_pages));
Store_field(physinfo, 8, cap_list);
+ Store_field(physinfo, 9, Val_int(c_physinfo.max_cpu_id + 1));
CAMLreturn(physinfo);
}