WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel] [PATCH]: xl: use libuuid to generate random UUID's

To: "Gianni Tedesco (3P)" <gianni.tedesco@xxxxxxxxxx>, Xen Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel] [PATCH]: xl: use libuuid to generate random UUID's
From: Ian Pratt <Ian.Pratt@xxxxxxxxxxxxx>
Date: Thu, 5 Aug 2010 03:19:11 +0100
Accept-language: en-US
Acceptlanguage: en-US
Cc: Ian Pratt <Ian.Pratt@xxxxxxxxxxxxx>, Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>, Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>
Delivery-date: Wed, 04 Aug 2010 19:20:20 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1280944162.18490.219.camel@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1280944162.18490.219.camel@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acsz/gNhkeHvEbbDRZmiZffSoskSGQARbaSQ
Thread-topic: [Xen-devel] [PATCH]: xl: use libuuid to generate random UUID's
> 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.

The MAC generation scheme in xend was awful -- it might be a good idea to take 
this opportunity to fix things in libxl.

The best approach is to generate locally administered MAC addresses hence 
giving us 46 bits of freedom rather than XenSource registered OUI addresses 
which have just 24 bits -- collisions will be *much* less likely. Further, it's 
best not to generate random addresses every time, but to derive the MAC address 
from a good hash of the VM UUID and the NIC number so that they are 
deterministic.

Ian

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel