|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH V5 04/32] libxl: libxl_uuid_copy now taks a ctx argument
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);
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |