From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= Subject: Re: [PATCH RFC 17/23] libxl: add support for FreeBSD uuid implementation Date: Tue, 22 Apr 2014 17:09:43 +0200 Message-ID: <53568637.2040808@citrix.com> References: <1397657612-57277-1-git-send-email-roger.pau@citrix.com> <1397657612-57277-18-git-send-email-roger.pau@citrix.com> <21328.2908.708764.738978@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WccKW-0004rg-6M for xen-devel@lists.xenproject.org; Tue, 22 Apr 2014 15:09:52 +0000 In-Reply-To: <21328.2908.708764.738978@mariner.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 Jackson Cc: xen-devel@lists.xenproject.org, Ian Campbell List-Id: xen-devel@lists.xenproject.org On 17/04/14 19:11, Ian Jackson wrote: > Roger Pau Monne writes ("[PATCH RFC 17/23] libxl: add support for FreeBSD uuid implementation"): >> Add the FreeBSD specific uuid implementation. Since uuid_t is not >> defined as an array, but as a struct on FreeBSD, use a union with a >> array in order to be able to return the uuid as a bytearray. > > I don't have a FreeBSD machine here to hand, but if it's a struct full > of >1-byte objects, aren't there endian problems with this approach ? I'm frankly not familiar at all with uuid or how it's supposed to work, but from what I saw, the NetBSD and FreeBSD implementations of uuid are very similar (most of FreeBSD code seems to be picked from NetBSD). I'm not sure what endian problems can come out of it, NetBSD uses the same approach. The only difference is that NetBSD directly defines the uuid field as an array, but on FreeBSD I've preferred to use a union of the native type with an array (so native functions get called by passing the right type, which is uuid_t), while libxl can still make use of the byte array. Roger.