direct-io.hg

changeset 8401:11cd619db035

Changed UUID / Xen handle formatting to be compatible with the OSF DCE UUIDs.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@leeni.uk.xensource.com
date Tue Dec 20 17:16:15 2005 +0000 (2005-12-20)
parents b62e324574d2
children d3b10a2a82d4
files tools/python/xen/xend/uuid.py xen/common/keyhandler.c
line diff
     1.1 --- a/tools/python/xen/xend/uuid.py	Thu Dec 15 18:38:49 2005 +0000
     1.2 +++ b/tools/python/xen/xend/uuid.py	Tue Dec 20 17:16:15 2005 +0000
     1.3 @@ -17,8 +17,13 @@
     1.4  #============================================================================
     1.5  
     1.6  
     1.7 -"""Universal(ly) Unique Identifiers (UUIDs).
     1.8 -"""
     1.9 +"""Universal Unique Identifiers (UUIDs).  By default, UUIDs generated here are
    1.10 +purely random, with no internal structure.  However, they are the same size,
    1.11 +and are formatted by the same conventions, as the UUIDs in the Open Software
    1.12 +Foundation's Distributed Computing Environment (OSF DCE).  This allows Xend to
    1.13 +be used with UUIDs generated as per the DCE specification, should that be
    1.14 +required.  These UUIDs are also, by no coincidence, the same size as the
    1.15 +'handle' stored by the Xen hypervisor along with the domain structure."""
    1.16  
    1.17  
    1.18  import commands
    1.19 @@ -54,7 +59,8 @@ def create():
    1.20  
    1.21  
    1.22  def toString(u):
    1.23 -    return "-".join(["%02x" * 4] * 4) % tuple(u)
    1.24 +    return "-".join(["%02x" * 4, "%02x" * 2, "%02x" * 2, "%02x" * 2,
    1.25 +                     "%02x" * 6]) % tuple(u)
    1.26  
    1.27  def fromString(s):
    1.28      s = s.replace('-', '')
     2.1 --- a/xen/common/keyhandler.c	Thu Dec 15 18:38:49 2005 +0000
     2.2 +++ b/xen/common/keyhandler.c	Tue Dec 20 17:16:15 2005 +0000
     2.3 @@ -112,8 +112,11 @@ static void do_task_queues(unsigned char
     2.4          printk("Xen: DOM %u, flags=%lx refcnt=%d nr_pages=%d "
     2.5                 "xenheap_pages=%d\n", d->domain_id, d->domain_flags,
     2.6                 atomic_read(&d->refcnt), d->tot_pages, d->xenheap_pages);
     2.7 -        printk("     handle=%02x%02x%02x%02x-%02x%02x%02x%02x-"
     2.8 -               "%02x%02x%02x%02x-%02x%02x%02x%02x\n",
     2.9 +        /* The handle is printed according to the OSF DCE UUID spec., even
    2.10 +           though it is not necessarily such a thing, for ease of use when it
    2.11 +           _is_ one of those. */
    2.12 +        printk("     handle=%02x%02x%02x%02x-%02x%02x-%02x%02x-"
    2.13 +               "%02x%02x-%02x%02x%02x%02x%02x%02x\n",
    2.14                 d->handle[ 0], d->handle[ 1], d->handle[ 2], d->handle[ 3],
    2.15                 d->handle[ 4], d->handle[ 5], d->handle[ 6], d->handle[ 7],
    2.16                 d->handle[ 8], d->handle[ 9], d->handle[10], d->handle[11],