# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID 11cd619db03540476cef8ec523d46d9a1d13973c
# Parent b62e324574d2acba81a4e61c9b55e4e7c8918920
Changed UUID / Xen handle formatting to be compatible with the OSF DCE UUIDs.
Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>
diff -r b62e324574d2 -r 11cd619db035 tools/python/xen/xend/uuid.py
--- a/tools/python/xen/xend/uuid.py Thu Dec 15 18:38:49 2005
+++ b/tools/python/xen/xend/uuid.py Tue Dec 20 17:16:15 2005
@@ -17,8 +17,13 @@
#============================================================================
-"""Universal(ly) Unique Identifiers (UUIDs).
-"""
+"""Universal Unique Identifiers (UUIDs). By default, UUIDs generated here are
+purely random, with no internal structure. However, they are the same size,
+and are formatted by the same conventions, as the UUIDs in the Open Software
+Foundation's Distributed Computing Environment (OSF DCE). This allows Xend to
+be used with UUIDs generated as per the DCE specification, should that be
+required. These UUIDs are also, by no coincidence, the same size as the
+'handle' stored by the Xen hypervisor along with the domain structure."""
import commands
@@ -54,7 +59,8 @@
def toString(u):
- return "-".join(["%02x" * 4] * 4) % tuple(u)
+ return "-".join(["%02x" * 4, "%02x" * 2, "%02x" * 2, "%02x" * 2,
+ "%02x" * 6]) % tuple(u)
def fromString(s):
s = s.replace('-', '')
diff -r b62e324574d2 -r 11cd619db035 xen/common/keyhandler.c
--- a/xen/common/keyhandler.c Thu Dec 15 18:38:49 2005
+++ b/xen/common/keyhandler.c Tue Dec 20 17:16:15 2005
@@ -112,8 +112,11 @@
printk("Xen: DOM %u, flags=%lx refcnt=%d nr_pages=%d "
"xenheap_pages=%d\n", d->domain_id, d->domain_flags,
atomic_read(&d->refcnt), d->tot_pages, d->xenheap_pages);
- printk(" handle=%02x%02x%02x%02x-%02x%02x%02x%02x-"
- "%02x%02x%02x%02x-%02x%02x%02x%02x\n",
+ /* The handle is printed according to the OSF DCE UUID spec., even
+ though it is not necessarily such a thing, for ease of use when it
+ _is_ one of those. */
+ printk(" handle=%02x%02x%02x%02x-%02x%02x-%02x%02x-"
+ "%02x%02x-%02x%02x%02x%02x%02x%02x\n",
d->handle[ 0], d->handle[ 1], d->handle[ 2], d->handle[ 3],
d->handle[ 4], d->handle[ 5], d->handle[ 6], d->handle[ 7],
d->handle[ 8], d->handle[ 9], d->handle[10], d->handle[11],
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|