[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2] libxl: replace the usage of uuid_t with a char array

On Wed, Apr 06, 2016 at 01:11:05PM +0200, Roger Pau Monne wrote:
> The internals of the uuid_t struct don't match a big endian octet stream on
> *BSD systems, which means that it cannot be directly casted to a
> uint8_t[16].
> In order to solve that change the type to be an unsigned char[16], which
> doesn't imply any other change on Linux. On *BSDs change the helpers so that
> the uuid is always stored as a big endian byte stream.
> NB: tested on FreeBSD and Linux only.
> Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> Discussed-with: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
> Discussed-with: Wei Liu <wei.liu2@xxxxxxxxxx>
> ---
> Cc: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
> Cc: Wei Liu <wei.liu2@xxxxxxxxxx>
> ---
> NB2: AFAICT the NetBSD version of libxl_uuid_from_string *could* be switched
> to the FreeBSD one (because NetBSD also has uuid_from_string), but I don't
> have a NetBSD box in order to test it.
> ---
> Changes since v1:
>  - Readd a line that was deleted by error.
> ---
>  tools/libxl/libxl_osdeps.h |  3 +++
>  tools/libxl/libxl_uuid.c   | 28 ++++++++++++++++++++--------
>  tools/libxl/libxl_uuid.h   | 21 ++++++++-------------

A thought: maybe it is worth to have a #define LIBXL_HAVE_UNIFIED_UUID
in libxl.h?

/* If this is defined, libxl_uuid is big endian 16-octet stream on all
 * platform. The libxl_uuid API family will handle transformation
 * between libxl_uuid format and OS specific format.


Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.