[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



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.

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.

Adding some details here...

In general it would be a good idea to recopy already *existing* schemes (unless it can be proven to be the wrong thing to do) already available in XCP and XCI into libxl, instead of reinventing new square wheels like here. (although this square wheel is in xl not in libxl actually)

The MAC generation, as the one Ian mentioned, is already available in the XCI toolstack and in the XCP toolstack (the code there is a bit more scattered so i'ld recommend reading the XCI one).

--
Vincent

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.