From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Egger Subject: Re: [PATCH]: xl: use libuuid to generate random UUID's Date: Thu, 5 Aug 2010 12:13:49 +0200 Message-ID: <201008051213.49800.Christoph.Egger@amd.com> References: <1280944162.18490.219.camel@qabil.uk.xensource.com> <4FA716B1526C7C4DB0375C6DADBC4EA37AD0596B2F@LONPMAILBOX01.citrite.net> <4C5A8216.6030607@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4C5A8216.6030607@eu.citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Ian Jackson , Ian Pratt , Vincent Hanquez , "Gianni Tedesco (3P)" , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Thursday 05 August 2010 11:19:18 Vincent Hanquez wrote: > On 05/08/10 03:19, Ian Pratt wrote: > >> Link to libuuid in xl et al and bring in the header file. Use libuuid to > >> generate UUID's which are actually UU and not merely pseudo-random :) > >> > >> As a side-effect I have also used libuuid to generate more random MAC > >> addresses rather than keeping the old code and simply xoring getpid() in > >> to the PRNG seed. > > I want to mention that Linux and NetBSD's uuid are different. While on Linux you link against -luuid on NetBSD uuid is part of libc. NetBSD implements DCE 1.1 (http://www.opengroup.org/dce/info/draft-leach-uuids-guids-01.txt, http://www.opengroup.org/onlinepubs/009629399/apdxa.htm). Linux implements a different standard (I don't know which one) where the API is different. Please have a look at tools/blktap2/include/blk_uuid.h and tools/blktap2/drivers/Makefile how to deal with both variants in a portable way. Christoph -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Einsteinring 24, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632