From: Ian Campbell Subject: Re: [PATCH 1 of 3 V6] tools/libxc: introduce page_aligned_alloc in xc_{minios, linux, solaris, netbsd}.c Date: Thu, 10 Nov 2011 16:44:19 +0000 Message-ID: <1320943459.955.230.camel@zakaz.uk.xensource.com> References: <58a24a7d4b8754069236.1320791986@athos.nss.cs.ubc.ca> <1320822437.16747.90.camel@dagon.hellion.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Shriram Rajagopalan Cc: "brendan@cs.ubc.ca" , "xen-devel@lists.xensource.com" , Ian Jackson List-Id: xen-devel@lists.xenproject.org On Thu, 2011-11-10 at 16:36 +0000, Shriram Rajagopalan wrote: > On 2011-11-08, at 11:07 PM, Ian Campbell wrote: > > > On Tue, 2011-11-08 at 22:39 +0000, rshriram@cs.ubc.ca wrote: > >> diff -r 54a5e994a241 -r 58a24a7d4b87 tools/libxc/xc_linux_osdep.c > >> --- a/tools/libxc/xc_linux_osdep.c Wed Nov 02 17:09:09 2011 +0000 > >> +++ b/tools/libxc/xc_linux_osdep.c Tue Nov 08 14:26:02 2011 -0800 > >> @@ -36,9 +36,17 @@ > >> #include > >> #include > >> > >> +#include "xc_private.h" > > > > I'd like to avoid including xc_private from this file. Although it's in > > tree it is a plugin and avoiding internal APIs serves to help ensure > > that external plugins can actually be written using the public APIs. > > > > I think you can make this function public, as long as you name it > > xc_blah. > > > > Ian. > > > > The reason I declared the function in xc_private.h was to maintain consistency, like discard_file_cache(). > But I see your point. > > Just to make sure I get it right this time. > Are you suggesting that I declare a > public function xc_page_aligned_alloc in a header like xenctrl.h and have respective platform specific implementations in xc_{minios,linux,netbsd}.c ? > That way I won't have to include xc_private.h in linux_osdep.c (it already includes xenctrl.h). That sounds about right. You could just export a xc_memalign rather than xc_page_aligned_alloc, your name is a bit of a mouthful and xc_memalign is a bit more general I guess? I'd expect a function called xc_page_aligned_alloc to take a number of pages rather than bytes. Either way is fine though. > And are you okay with other modifications in these files (like abstracting out memaligns from privcmd_hypercall_alloc() )..? Looks fine. Ian. > > Shriram > > >