From: Ian Campbell Subject: Re: [PATCH 6 of 6] [OCAML] Small improvement to the ocaml xenctrl library Date: Fri, 7 Oct 2011 11:59:38 +0100 Message-ID: <1317985179.21903.323.camel@zakaz.uk.xensource.com> References: <82d81b98b5dadb80853f.1317983164@snoosnoo2.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <82d81b98b5dadb80853f.1317983164@snoosnoo2.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jon Ludlam Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Fri, 2011-10-07 at 11:26 +0100, Jon Ludlam wrote: > Add a new field 'max_nr_cpus' to the physinfo type in the ocaml xc bindings > > Signed-off-by: Zheng Li Acked-by: Ian Campbell > > diff -r fdca6d8c0c5a -r 82d81b98b5da tools/ocaml/libs/xc/xenctrl.ml > --- a/tools/ocaml/libs/xc/xenctrl.ml > +++ b/tools/ocaml/libs/xc/xenctrl.ml > @@ -70,6 +70,7 @@ > scrub_pages : nativeint; > (* XXX hw_cap *) > capabilities : physinfo_cap_flag list; > + max_nr_cpus : int; > } > > type version = > diff -r fdca6d8c0c5a -r 82d81b98b5da tools/ocaml/libs/xc/xenctrl.mli > --- a/tools/ocaml/libs/xc/xenctrl.mli > +++ b/tools/ocaml/libs/xc/xenctrl.mli > @@ -52,6 +52,7 @@ > 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 -r fdca6d8c0c5a -r 82d81b98b5da tools/ocaml/libs/xc/xenctrl_stubs.c > --- a/tools/ocaml/libs/xc/xenctrl_stubs.c > +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c > @@ -534,6 +534,7 @@ > > if (retval) > failwith_xc(_H(xch)); > + > ring[size] = '\0'; > CAMLreturn(caml_copy_string(ring)); > } > @@ -573,7 +574,7 @@ > } > } > > - 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 @@ > 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); > } > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel