From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chao Peng Subject: Re: [PATCH for Xen 4.6 1/5] tools/libxl: introduce libxl_socket_bitmap_fill Date: Tue, 29 Sep 2015 10:47:12 +0800 Message-ID: <20150929024712.GC5813@pengc-linux.bj.intel.com> References: <1443441293-4287-1-git-send-email-chao.p.peng@linux.intel.com> <1443441293-4287-2-git-send-email-chao.p.peng@linux.intel.com> <20150928141227.GB13821@zion.uk.xensource.com> <1443452038.3276.77.camel@citrix.com> Reply-To: Chao Peng Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1443452038.3276.77.camel@citrix.com> 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: Ian.Jackson@eu.citrix.com, stefano.stabellini@eu.citrix.com, Wei Liu , Ian.Campbell@citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Mon, Sep 28, 2015 at 04:53:58PM +0200, Dario Faggioli wrote: > On Mon, 2015-09-28 at 15:12 +0100, Wei Liu wrote: > > On Mon, Sep 28, 2015 at 07:54:49PM +0800, Chao Peng wrote: > > > > diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h > > > index 5f9047c..5a91687 100644 > > > --- a/tools/libxl/libxl.h > > > +++ b/tools/libxl/libxl.h > > > > > > /* > > > - * LIBXL_HAVE_SOCKET_BITMAP_ALLOC > > > + * LIBXL_HAVE_SOCKET_BITMAP > > > * > > > - * If this is defined, then libxl_socket_bitmap_alloc exists. > > > + * If this is defined, then libxl_socket_bitmap_alloc and > > > + * libxl_socket_bitmap_Fill exist. > > > > _Fill -> _fill. > > > Right. > > However, it seems to me that the function would be better named > libxl_get_online_sockets() or something like that. > > I see that you want the actual map. For CPUs and NUMA nodes, we do have > libxl_get_online_{cpus,nodes}(), but they return the number of online > CPUs and nodes, so for consistency, libxl_get_online_sockets() would > better (if necessary at some point) behave similarly. Actually for the similar purpose of libxl_get_online_{cpus,nodes}, we have libxl__count_physical_sockets() already, which would ideally be called libxl_get_online_sockets(). Since it's not public so we have liberty to change it in the future, if everyone agrees. > > What about libxl_get_online_socketmap() ? This is still a nice (IMO) > name for what you're after here, and it leaves us room to implement > libxl_get_online_cpumap() and libxl_get_online_nodemap(), if we'll ever > need those. > > Thoughs? I have been strugging with the naming, but libxl_get_online_socketmap() looks right for me. Thanks for suggestion. Chao