From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Subject: Re: [PATCH 2/2] libxl: fix UUID usage on FreeBSD Date: Fri, 15 Jan 2016 16:11:31 +0100 Message-ID: <56990C23.3030803@citrix.com> References: <1452604467-65746-1-git-send-email-roger.pau@citrix.com> <1452604467-65746-3-git-send-email-roger.pau@citrix.com> <1452853602.32341.61.camel@citrix.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 1aK62K-0002TY-0s for xen-devel@lists.xenproject.org; Fri, 15 Jan 2016 15:11:36 +0000 In-Reply-To: <1452853602.32341.61.camel@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: Ian Campbell , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org El 15/01/16 a les 11.26, Ian Campbell ha escrit: > On Tue, 2016-01-12 at 14:14 +0100, Roger Pau Monne wrote: >> libxl makes the assumtion that libxl_uuid == uuid_t, > > ("assumption") > >> and that uuid_t can be >> freely used as a byte array. This is not true on FreeBSD (and NetBSD >> too, not sure about other BSD UUID implementations), where the internals >> of >> uuid don't match what libxl expects as a byte array because of endianness >> issues. >> >> Fix this by converting the libxl_uuid type to a struct with an internal >> uuid_t field and a byte-array. Also introduce a new function that should >> be >> used in order to load a byte array into a uuid_t struct. > > Do we really need to keep both the uuid_t and the byte-array representation > around? It looks to me as if we only really need the byte-array form, which > might then involve changing various uses of uuid_* internally to just be > mem*. Yes, we can remove the uuid_t from libxl_uuid, but this is AFAICT a structure that belongs to the stable API. My current change keeps the same layout by turning the union into a struct, but without changing the fields. Roger.