From: Ian Campbell Subject: Re: [PATCH V5 04/32] libxl: libxl_uuid_copy now taks a ctx argument Date: Thu, 15 May 2014 17:51:07 +0100 Message-ID: <1400172667.883.31.camel@kazak.uk.xensource.com> References: <1400018054-26038-1-git-send-email-wei.liu2@citrix.com> <1400018054-26038-5-git-send-email-wei.liu2@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1400018054-26038-5-git-send-email-wei.liu2@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: Wei Liu Cc: ian.jackson@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org 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. > { > 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? > 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 > +void libxl_uuid_copy(dst, src) libxl_uuid_copy(NULL, dst, src) > +#endif > + > void libxl_uuid_clear(libxl_uuid *uuid); > int libxl_uuid_compare(libxl_uuid *uuid1, libxl_uuid *uuid2); > uint8_t *libxl_uuid_bytearray(libxl_uuid *uuid);