From: Ian Jackson Subject: Re: [PATCH V4 16/24] libxl: copy function for builtin types Date: Wed, 7 May 2014 11:47:40 +0100 Message-ID: <21354.3916.351743.216581@mariner.uk.xensource.com> References: <1398949101-23320-1-git-send-email-wei.liu2@citrix.com> <1398949101-23320-17-git-send-email-wei.liu2@citrix.com> <1399384993.3014.152.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1399384993.3014.152.camel@kazak.uk.xensource.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: Ian Campbell Cc: Wei Liu , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Ian Campbell writes ("Re: [PATCH V4 16/24] libxl: copy function for builtin types"): > On Thu, 2014-05-01 at 13:58 +0100, Wei Liu wrote: > > +typedef struct libxl__ctx libxl_ctx; > > + > > int libxl_uuid_is_nil(libxl_uuid *uuid); > > void libxl_uuid_generate(libxl_uuid *uuid); > > int libxl_uuid_from_string(libxl_uuid *uuid, const char *in); > > void libxl_uuid_copy(libxl_uuid *dst, const libxl_uuid *src); > > +void libxl_uuid_copy_ctx(libxl_ctx *ctx, libxl_uuid *dst, > > + const libxl_uuid *src); > > Hrm, this is rather unfortunate. > > All of these only take a ctx so they can use NOGC. I wonder if a #define > INIT_NOGC which provides a suitable gc (with maxsize == -1) might be > nicer than this? The problem with this is that the caller's log functions won't be respected. I think it would be better to make all of the copy functions take a ctx. Alternatively we should at least document this restriction, but also then we shouldn't ever call the copy functions from within libxl which (without reading the rest of the series) I think would probably defeat the point. Ian.