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-api

Re: [Xen-API] [xen-api-libs.hg:PATCH 0 of 2] Uuid stuff.

To: "magnus.therning@xxxxxxxxxxxxx" <magnus.therning@xxxxxxxxxxxxx>
Subject: Re: [Xen-API] [xen-api-libs.hg:PATCH 0 of 2] Uuid stuff.
From: Jonathan Knowles <jonathan.knowles@xxxxxxxxxxxxx>
Date: Thu, 29 Jul 2010 17:30:31 +0100
Cc: "xen-api@xxxxxxxxxxxxxxxxxxx" <xen-api@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 29 Jul 2010 09:33:17 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1280418411@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1280418411@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.1.5) Gecko/20091204 Lightning/1.0b1 Thunderbird/3.0
On 29/07/10 16:46, magnus.therning@xxxxxxxxxxxxx wrote:
This is not ready for merging, but I'd like some comments on the code
and direction.

Besides the minor clean-up (is more needed?) it introduces a new
function, make_uuid_random, which reads from /dev/random (and
therefore may block).

The plan is to change make_uuid to use the PRNG in Random, and then
modify xapi so that make_uuid_random is used where it's necessary
(creating pool secret and sessions, what else?).

After applying your patches, UUID has two constructors:

val make_uuid        : unit -> 'a t
val make_uuid_random : unit -> 'a  t

If your intent is that:

    * function "make_uuid"        uses a PRNG
    * function "make_uuid_random" uses /dev/random

then why not make the difference more explicit to the caller.
For example:

val make_uuid_pseudo_random : unit -> 'a t
val make_uuid_really_random : unit -> 'a t

Otherwise, it's not very clear to users of the API what they'll
get by calling "make_uuid".

Cheers,
Jonathan
--------
Jonathan Knowles

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api