mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
Changed UUID / Xen handle formatting to be compatible with the OSF DCE UUIDs.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
1 parent
30e49102ed
commit
c5ea66cfd2
2 files changed
+14
-5
No files matched your search
@@ -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 create():
|
||||
|
||||
|
||||
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('-', '')
|
||||
|
||||