From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [PATCH 03 of 11] libxc, libxl: introduce xc_nodemap_t and libxl_nodemap Date: Thu, 31 May 2012 16:41:39 +0100 Message-ID: <4FC79133.6030703@eu.citrix.com> References: <7d16724e5eced0986454.1338466268@Solace> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <7d16724e5eced0986454.1338466268@Solace> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Dario Faggioli Cc: Andre Przywara , Ian Campbell , Stefano Stabellini , Juergen Gross , Ian Jackson , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On 31/05/12 13:11, Dario Faggioli wrote: > As NUMA node-related counterparts of xc_cpumap_t and libxl_cpumap. > > This is in preparation of making it possible to manipulate > NUMA nodes from the toolstack(s). > > Signed-off-by: Dario Faggioli > > diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c > --- a/tools/libxc/xc_misc.c > +++ b/tools/libxc/xc_misc.c > @@ -35,11 +35,30 @@ int xc_get_max_cpus(xc_interface *xch) > return max_cpus; > } > > +int xc_get_max_nodes(xc_interface *xch) > +{ > + static int max_nodes = 0; > + xc_physinfo_t physinfo; > + > + if ( max_nodes ) > + return max_nodes; > + > + if ( !xc_physinfo(xch,&physinfo) ) > + max_nodes = physinfo.max_node_id + 1; > + > + return max_nodes; What does xc_physinfo() return? Should this return the error message rather than 0 if it fails? -George