xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Wei Liu <wei.liu2@citrix.com>
Subject: Re: [PATCH v2] libxl: replace the usage of uuid_t with a char array
Date: Thu, 7 Apr 2016 17:17:23 +0100	[thread overview]
Message-ID: <20160407161723.GB18120@citrix.com> (raw)
In-Reply-To: <1459941065-17573-1-git-send-email-roger.pau@citrix.com>

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@citrix.com>
> Discussed-with: Ian Jackson <Ian.Jackson@eu.citrix.com>
> Discussed-with: Wei Liu <wei.liu2@citrix.com>
> ---
> Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
> Cc: Wei Liu <wei.liu2@citrix.com>
> ---
> 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.
 */
#define LBIXL_HAVE_UNIFIED_UUID 1

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  parent reply	other threads:[~2016-04-07 16:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-06 11:11 [PATCH v2] libxl: replace the usage of uuid_t with a char array Roger Pau Monne
2016-04-06 11:14 ` Wei Liu
2016-04-07 16:12 ` Wei Liu
2016-04-07 16:17 ` Wei Liu [this message]
2016-04-07 17:41   ` Ian Jackson
2016-04-08 10:29     ` Roger Pau Monné
2016-04-08 13:42       ` Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160407161723.GB18120@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).