From: Wei Liu Subject: Re: [PATCH V5 04/32] libxl: libxl_uuid_copy now taks a ctx argument Date: Thu, 15 May 2014 18:13:39 +0100 Message-ID: <20140515171339.GD10525@zion.uk.xensource.com> References: <1400018054-26038-1-git-send-email-wei.liu2@citrix.com> <1400018054-26038-5-git-send-email-wei.liu2@citrix.com> <1400172667.883.31.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1400172667.883.31.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: ian.jackson@eu.citrix.com, Wei Liu , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Thu, May 15, 2014 at 05:51:07PM +0100, Ian Campbell wrote: > On Tue, 2014-05-13 at 22:53 +0100, Wei Liu wrote: > > @@ -82,7 +82,7 @@ int libxl_uuid_from_string(libxl_uuid *uuid, const char *in) > > } > > #undef LIBXL__UUID_PTRS > > > > -void libxl_uuid_copy(libxl_uuid *dst, const libxl_uuid *src) > > +void libxl_uuid_copy(libxl_ctx *ctx, libxl_uuid *dst, const libxl_uuid *src) > > Since you might get NULL here I think all these ctx params should be > called ctx_unused or something, in case someone thinks they can use it. > > Alternatively ctx_opt to indicate that it is optional and that care must > be taken if using it. > OK. > > { > > memcpy(dst->uuid, src->uuid, sizeof(dst->uuid)); > > } > > diff --git a/tools/libxl/libxl_uuid.h b/tools/libxl/libxl_uuid.h > > index 93c65a7..37c4d5f 100644 > > --- a/tools/libxl/libxl_uuid.h > > +++ b/tools/libxl/libxl_uuid.h > > @@ -53,10 +53,15 @@ typedef struct { > > > > #endif > > > > +typedef struct libxl__ctx libxl_ctx; > > Maybe libxl_uuid.h should include libxl.h? > That leads to circular inclusion. > > 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(libxl_ctx *ctx, libxl_uuid *dst, const libxl_uuid *src); > > +#if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x040500 > > You need to add 0x040500 to the list of valid versions in libxl.h > OK. Wei.