]> xenbits.xensource.com Git - libvirt.git/commitdiff
Cleanup UUID apis & constants
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 9 Aug 2007 20:19:12 +0000 (20:19 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Thu, 9 Aug 2007 20:19:12 +0000 (20:19 +0000)
50 files changed:
ChangeLog
proxy/Makefile.am
qemud/internal.h
src/libvirt.c
src/openvz_conf.c
src/openvz_conf.h
src/qemu_conf.c
src/qemu_conf.h
src/test.c
src/uuid.c
src/uuid.h
src/xend_internal.c
src/xm_internal.c
src/xml.c
src/xml.h
tests/sexpr2xmldata/sexpr2xml-curmem.xml
tests/sexpr2xmldata/sexpr2xml-disk-block.xml
tests/sexpr2xmldata/sexpr2xml-disk-drv-blktap-qcow.xml
tests/sexpr2xmldata/sexpr2xml-disk-drv-blktap-raw.xml
tests/sexpr2xmldata/sexpr2xml-disk-file.xml
tests/sexpr2xmldata/sexpr2xml-fv-localtime.xml
tests/sexpr2xmldata/sexpr2xml-fv-usbmouse.xml
tests/sexpr2xmldata/sexpr2xml-fv-usbtablet.xml
tests/sexpr2xmldata/sexpr2xml-fv-utc.xml
tests/sexpr2xmldata/sexpr2xml-fv-v2.xml
tests/sexpr2xmldata/sexpr2xml-fv.xml
tests/sexpr2xmldata/sexpr2xml-net-bridged.xml
tests/sexpr2xmldata/sexpr2xml-net-routed.xml
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml
tests/sexpr2xmldata/sexpr2xml-pv-bootloader.xml
tests/sexpr2xmldata/sexpr2xml-pv-vfb-new.xml
tests/sexpr2xmldata/sexpr2xml-pv-vfb-orig.xml
tests/sexpr2xmldata/sexpr2xml-pv.xml
tests/xmconfigdata/test-fullvirt-localtime.cfg
tests/xmconfigdata/test-fullvirt-localtime.xml
tests/xmconfigdata/test-fullvirt-new-cdrom.cfg
tests/xmconfigdata/test-fullvirt-new-cdrom.xml
tests/xmconfigdata/test-fullvirt-old-cdrom.cfg
tests/xmconfigdata/test-fullvirt-old-cdrom.xml
tests/xmconfigdata/test-fullvirt-usbmouse.cfg
tests/xmconfigdata/test-fullvirt-usbmouse.xml
tests/xmconfigdata/test-fullvirt-usbtablet-no-bus.xml
tests/xmconfigdata/test-fullvirt-usbtablet.cfg
tests/xmconfigdata/test-fullvirt-usbtablet.xml
tests/xmconfigdata/test-fullvirt-utc.cfg
tests/xmconfigdata/test-fullvirt-utc.xml
tests/xmconfigdata/test-paravirt-new-pvfb.cfg
tests/xmconfigdata/test-paravirt-new-pvfb.xml
tests/xmconfigdata/test-paravirt-old-pvfb.cfg
tests/xmconfigdata/test-paravirt-old-pvfb.xml

index 85873f4fc23f9a4cbc62ee0bb99efec16bc855d5..abb1442f986376aa16ba05025a6cb867bd23716c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Thu Aug  9 14:27:00 EST 2007 Daniel P. Berrange <berrange@redhat.com>
+
+       * src/libvirt.c, src/openvz_conf.c, src/qemu_conf.c,
+       src/test.c, src/xm_internal.c, src/xend_internal.c: Use
+       virUUIDFormat() / virUUIDGenerate / virUUIDParse apis.
+       * qemu/internal.h: Remove unused UUID_LEN constants
+       * src/openvz_conf.h, src/qemu_conf.h: Remove duplicated
+       UUID length constants
+       * src/xml.c, src/xml.h: Remove virParseUUID api
+       * src/uuid.h, src/uuid.c: Add virUUIDFormat() api.
+       * proxy/Makefile.am: Include uuid.o
+
 Tue Aug  7 16:35:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
 
        * src/Makefile.am: gnutls_1_0_compat.h to list of sources
index 487458de352b10fc34fce5cac30c1363a0c45f7b..90fd6bcd538553f870aa7599f471d8a8acf812fd 100644 (file)
@@ -10,7 +10,7 @@ libexec_PROGRAMS = libvirt_proxy
 libvirt_proxy_SOURCES = libvirt_proxy.c @top_srcdir@/src/xend_internal.c \
            @top_srcdir@/src/xen_internal.c @top_srcdir@/src/virterror.c \
            @top_srcdir@/src/sexpr.c @top_srcdir@/src/xml.c \
-            @top_srcdir@/src/xs_internal.c @top_srcdir@/src/buf.c
+            @top_srcdir@/src/xs_internal.c @top_srcdir@/src/buf.c @top_srcdir@/src/uuid.c
 libvirt_proxy_LDFLAGS = $(WARN_CFLAGS)
 libvirt_proxy_DEPENDENCIES =
 libvirt_proxy_LDADD =
index 95704622d0fb962573b5e66addbac881bc2c195e..744e1763814e9ff9491b5951c69cf803487cd0d0 100644 (file)
@@ -48,8 +48,6 @@
 #define ATTRIBUTE_FORMAT(...)
 #endif
 
-#define UUID_LEN 16
-
 typedef enum {
     QEMUD_ERR,
     QEMUD_WARN,
index caf5aa94c5defdaf24fca8e7c37f785a784c0c52..5ef3ad0cf332d3ff59e9711378d7d2e63e4f84ec 100644 (file)
@@ -25,7 +25,7 @@
 #include "internal.h"
 #include "driver.h"
 
-#include "xml.h"
+#include "uuid.h"
 #include "test.h"
 #include "xen_unified.h"
 #include "remote_internal.h"
@@ -1384,22 +1384,6 @@ virDomainGetUUID(virDomainPtr domain, unsigned char *uuid)
     if (domain->id == 0) {
         memset(uuid, 0, VIR_UUID_BUFLEN);
     } else {
-#if 0
-        /* Probably legacy code: It appears that we always fill in
-         * the UUID when creating the virDomain structure, so this
-         * shouldn't be necessary.
-         */
-        if ((domain->uuid[0] == 0) && (domain->uuid[1] == 0) &&
-            (domain->uuid[2] == 0) && (domain->uuid[3] == 0) &&
-            (domain->uuid[4] == 0) && (domain->uuid[5] == 0) &&
-            (domain->uuid[6] == 0) && (domain->uuid[7] == 0) &&
-            (domain->uuid[8] == 0) && (domain->uuid[9] == 0) &&
-            (domain->uuid[10] == 0) && (domain->uuid[11] == 0) &&
-            (domain->uuid[12] == 0) && (domain->uuid[13] == 0) &&
-            (domain->uuid[14] == 0) && (domain->uuid[15] == 0))
-            xenDaemonDomainLookupByName_ids(domain->conn, domain->name,
-                                &domain->uuid[0]);
-#endif
         memcpy(uuid, &domain->uuid[0], VIR_UUID_BUFLEN);
     }
     return (0);
@@ -1433,12 +1417,7 @@ virDomainGetUUIDString(virDomainPtr domain, char *buf)
     if (virDomainGetUUID(domain, &uuid[0]))
         return (-1);
 
-    snprintf(buf, VIR_UUID_STRING_BUFLEN,
-       "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
-                      uuid[0], uuid[1], uuid[2], uuid[3],
-                      uuid[4], uuid[5], uuid[6], uuid[7],
-                      uuid[8], uuid[9], uuid[10], uuid[11],
-                      uuid[12], uuid[13], uuid[14], uuid[15]);
+    virUUIDFormat(uuid, buf);
     return (0);
 }
 
@@ -2853,14 +2832,9 @@ virNetworkGetUUIDString(virNetworkPtr network, char *buf)
     }
 
     if (virNetworkGetUUID(network, &uuid[0]))
-       return (-1);
+        return (-1);
 
-    snprintf(buf, VIR_UUID_STRING_BUFLEN,
-       "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
-                      uuid[0], uuid[1], uuid[2], uuid[3],
-                      uuid[4], uuid[5], uuid[6], uuid[7],
-                      uuid[8], uuid[9], uuid[10], uuid[11],
-                      uuid[12], uuid[13], uuid[14], uuid[15]);
+    virUUIDFormat(uuid, buf);
     return (0);
 }
 
index 2dc3f6c0c0ba88d6fc815ee428a273ac72f8ddb4..964221aacf93d34e2e9044b911808e2d424dca45 100644 (file)
@@ -76,7 +76,7 @@ struct openvz_vm
     struct openvz_vm *vm = driver->vms;
 
     while (vm) {
-        if (!memcmp(vm->vmdef->uuid, uuid, OPENVZ_UUID_MAX))
+        if (!memcmp(vm->vmdef->uuid, uuid, VIR_UUID_BUFLEN))
             return vm;
         vm = vm->next;
     }
@@ -400,8 +400,8 @@ static int
 openvzSetUUID(int vpsid)
 {
     char conf_file[PATH_MAX];
-    char uuid[VIR_UUID_STRING_BUFLEN];
-    unsigned char new_uuid[VIR_UUID_BUFLEN];
+    char uuidstr[VIR_UUID_STRING_BUFLEN];
+    unsigned char uuid[VIR_UUID_BUFLEN];
     char *conf_dir;
     int fd, ret, i;
 
@@ -418,11 +418,9 @@ openvzSetUUID(int vpsid)
         return -1;
 
     if(uuid[0] == (int)NULL) {
-        virUUIDGenerate(new_uuid);
-        bzero(uuid, VIR_UUID_STRING_BUFLEN);
-        for(i = 0; i < VIR_UUID_BUFLEN; i ++)
-            sprintf(uuid + (i * 2), "%02x", (unsigned char)new_uuid[i]);
-    
+        virUUIDGenerate(uuid);
+        virUUIDFormat(uuid, uuidstr);
+
         lseek(fd, 0, SEEK_END);
         write(fd, "\n#UUID: ", 8);
         write(fd, uuid, strlen(uuid));
index 8871dbfcbb85d6361ac0c35f6f57348625470747..e869ddab7422fcb635748c3af1f7cf5e4c295666 100644 (file)
@@ -27,7 +27,6 @@
 #include "openvz_driver.h"
 
 #define OPENVZ_NAME_MAX 8
-#define OPENVZ_UUID_MAX 16
 #define OPENVZ_TMPL_MAX 256
 #define OPENVZ_UNAME_MAX    32
 #define OPENVZ_IP_MAX   16
@@ -74,7 +73,7 @@ struct openvz_net_def {
 
 struct openvz_vm_def {
     char name[OPENVZ_NAME_MAX];
-    unsigned char uuid[OPENVZ_UUID_MAX];
+    unsigned char uuid[VIR_UUID_BUFLEN];
     char profile[OPENVZ_PROFILE_MAX];
     struct openvz_fs_def fs;
     struct openvz_net_def net;
index 926b1d8179a87c771f414898c0604b12a6f1de32..79dd18002b7c50b0c5b9e4e644c87179a590681f 100644 (file)
@@ -83,7 +83,7 @@ struct qemud_vm *qemudFindVMByUUID(const struct qemud_driver *driver,
     struct qemud_vm *vm = driver->vms;
 
     while (vm) {
-        if (!memcmp(vm->def->uuid, uuid, QEMUD_UUID_RAW_LEN))
+        if (!memcmp(vm->def->uuid, uuid, VIR_UUID_BUFLEN))
             return vm;
         vm = vm->next;
     }
@@ -109,7 +109,7 @@ struct qemud_network *qemudFindNetworkByUUID(const struct qemud_driver *driver,
     struct qemud_network *network = driver->networks;
 
     while (network) {
-        if (!memcmp(network->def->uuid, uuid, QEMUD_UUID_RAW_LEN))
+        if (!memcmp(network->def->uuid, uuid, VIR_UUID_BUFLEN))
             return network;
         network = network->next;
     }
@@ -2724,6 +2724,7 @@ char *qemudGenerateXML(virConnectPtr conn,
                        int live) {
     virBufferPtr buf = 0;
     unsigned char *uuid;
+    char uuidstr[VIR_UUID_STRING_BUFLEN];
     struct qemud_vm_disk_def *disk;
     struct qemud_vm_net_def *net;
     struct qemud_vm_input_def *input;
@@ -2762,11 +2763,8 @@ char *qemudGenerateXML(virConnectPtr conn,
         goto no_memory;
 
     uuid = def->uuid;
-    if (virBufferVSprintf(buf, "  <uuid>%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x</uuid>\n",
-                          uuid[0], uuid[1], uuid[2], uuid[3],
-                          uuid[4], uuid[5], uuid[6], uuid[7],
-                          uuid[8], uuid[9], uuid[10], uuid[11],
-                          uuid[12], uuid[13], uuid[14], uuid[15]) < 0)
+    virUUIDFormat(uuid, uuidstr);
+    if (virBufferVSprintf(buf, "  <uuid>%s</uuid>\n", uuidstr) < 0)
         goto no_memory;
     if (virBufferVSprintf(buf, "  <memory>%d</memory>\n", def->maxmem) < 0)
         goto no_memory;
@@ -3023,6 +3021,7 @@ char *qemudGenerateNetworkXML(virConnectPtr conn,
                               struct qemud_network_def *def) {
     virBufferPtr buf = 0;
     unsigned char *uuid;
+    char uuidstr[VIR_UUID_STRING_BUFLEN];
 
     buf = virBufferNew (QEMUD_MAX_XML_LEN);
     if (!buf)
@@ -3035,11 +3034,8 @@ char *qemudGenerateNetworkXML(virConnectPtr conn,
         goto no_memory;
 
     uuid = def->uuid;
-    if (virBufferVSprintf(buf, "  <uuid>%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x</uuid>\n",
-                          uuid[0], uuid[1], uuid[2], uuid[3],
-                          uuid[4], uuid[5], uuid[6], uuid[7],
-                          uuid[8], uuid[9], uuid[10], uuid[11],
-                          uuid[12], uuid[13], uuid[14], uuid[15]) < 0)
+    virUUIDFormat(uuid, uuidstr);
+    if (virBufferVSprintf(buf, "  <uuid>%s</uuid>\n", uuidstr) < 0)
         goto no_memory;
 
     if (def->forward) {
index 836bcb0f7178ce71b6828d62203e186465b8a49a..60a38b7ada8ca2bdf0a8dec9621432c3c6d0c4f3 100644 (file)
@@ -78,7 +78,6 @@ enum qemud_vm_net_type {
     QEMUD_NET_BRIDGE,
 };
 
-#define QEMUD_UUID_RAW_LEN 16
 #define QEMUD_MAX_NAME_LEN 50
 #define QEMUD_MAX_XML_LEN 4096
 #define QEMUD_MAX_ERROR_LEN 1024
@@ -170,7 +169,7 @@ struct qemud_vm_os_def {
 /* Guest VM main configuration */
 struct qemud_vm_def {
     int virtType;
-    unsigned char uuid[QEMUD_UUID_RAW_LEN];
+    unsigned char uuid[VIR_UUID_BUFLEN];
     char name[QEMUD_MAX_NAME_LEN];
 
     int memory;
@@ -232,7 +231,7 @@ struct qemud_dhcp_range_def {
 
 /* Virtual Network main configuration */
 struct qemud_network_def {
-    unsigned char uuid[QEMUD_UUID_RAW_LEN];
+    unsigned char uuid[VIR_UUID_BUFLEN];
     char name[QEMUD_MAX_NAME_LEN];
 
     char bridge[BR_IFNAME_MAXLEN];
index d31518a73f212e859e6bbd06c873ea8425c1f689..2b11d4dec3c09c752940118de4d23ae13943a888 100644 (file)
@@ -42,7 +42,7 @@
 #include "test.h"
 #include "xml.h"
 #include "buf.h"
-
+#include "uuid.h"
 
 struct _testDev {
     char name[20];
@@ -206,8 +206,7 @@ static int testLoadDomain(virConnectPtr conn,
     xmlNodePtr root = NULL;
     xmlXPathContextPtr ctxt = NULL;
     char *name = NULL;
-    unsigned char rawuuid[VIR_UUID_BUFLEN];
-    char *dst_uuid;
+    unsigned char uuid[VIR_UUID_BUFLEN];
     struct timeval tv;
     unsigned long memory = 0;
     unsigned long maxMem = 0;
@@ -248,8 +247,7 @@ static int testLoadDomain(virConnectPtr conn,
         testError(conn, NULL, NULL, VIR_ERR_XML_ERROR, _("domain uuid"));
         goto error;
     }
-    dst_uuid = (char *) &rawuuid[0];
-    if (!(virParseUUID((char **)&dst_uuid, str))) {
+    if (virUUIDParse(str, uuid) < 0) {
         testError(conn, NULL, NULL, VIR_ERR_XML_ERROR, _("domain uuid"));
         goto error;
     }
@@ -332,7 +330,7 @@ static int testLoadDomain(virConnectPtr conn,
     if (memory > maxMem)
         memory = maxMem;
 
-    memmove(privconn->domains[handle].uuid, rawuuid, VIR_UUID_BUFLEN);
+    memmove(privconn->domains[handle].uuid, uuid, VIR_UUID_BUFLEN);
     privconn->domains[handle].info.maxMem = maxMem;
     privconn->domains[handle].info.memory = memory;
     privconn->domains[handle].info.state = domid < 0 ? VIR_DOMAIN_SHUTOFF : VIR_DOMAIN_RUNNING;
@@ -404,8 +402,7 @@ static int testLoadNetwork(virConnectPtr conn,
     xmlNodePtr root = NULL;
     xmlXPathContextPtr ctxt = NULL;
     char *name = NULL, *bridge = NULL;
-    unsigned char rawuuid[VIR_UUID_BUFLEN];
-    char *dst_uuid;
+    unsigned char uuid[VIR_UUID_BUFLEN];
     char *str;
     char *ipaddress = NULL, *ipnetmask = NULL, *dhcpstart = NULL, *dhcpend = NULL;
     int forward;
@@ -438,8 +435,7 @@ static int testLoadNetwork(virConnectPtr conn,
         testError(conn, NULL, NULL, VIR_ERR_XML_ERROR, _("network uuid"));
         goto error;
     }
-    dst_uuid = (char *) &rawuuid[0];
-    if (!(virParseUUID((char **)&dst_uuid, str))) {
+    if (virUUIDParse(str, uuid) < 0) {
         testError(conn, NULL, NULL, VIR_ERR_XML_ERROR, _("network uuid"));
         goto error;
     }
@@ -498,7 +494,7 @@ static int testLoadNetwork(virConnectPtr conn,
         bridge = NULL;
     }
 
-    memmove(privconn->networks[handle].uuid, rawuuid, VIR_UUID_BUFLEN);
+    memmove(privconn->networks[handle].uuid, uuid, VIR_UUID_BUFLEN);
     privconn->networks[handle].forward = forward;
     if (forwardDev) {
         strncpy(privconn->networks[handle].forwardDev, forwardDev, sizeof(privconn->networks[handle].forwardDev)-1);
@@ -664,7 +660,7 @@ static int testOpenFromFile(virConnectPtr conn,
     char *str;
     xmlDocPtr xml = NULL;
     xmlNodePtr root = NULL;
-    xmlNodePtr *domains, *networks;
+    xmlNodePtr *domains, *networks = NULL;
     xmlXPathContextPtr ctxt = NULL;
     virNodeInfoPtr nodeInfo;
     testConnPtr privconn = malloc(sizeof(testConn));
@@ -1474,6 +1470,7 @@ static char *testDomainDumpXML(virDomainPtr domain, int flags ATTRIBUTE_UNUSED)
     virBufferPtr buf;
     char *xml;
     unsigned char *uuid;
+    char uuidstr[VIR_UUID_STRING_BUFLEN];
     GET_DOMAIN(domain, NULL);
 
     if (!(buf = virBufferNew(4000))) {
@@ -1484,13 +1481,8 @@ static char *testDomainDumpXML(virDomainPtr domain, int flags ATTRIBUTE_UNUSED)
     virBufferVSprintf(buf, "<domain type='test' id='%d'>\n", domain->id);
     virBufferVSprintf(buf, "  <name>%s</name>\n", domain->name);
     uuid = domain->uuid;
-    virBufferVSprintf(buf,
-                      "  <uuid>%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x</uuid>\n",
-                      uuid[0], uuid[1], uuid[2], uuid[3],
-                      uuid[4], uuid[5], uuid[6], uuid[7],
-                      uuid[8], uuid[9], uuid[10], uuid[11],
-                      uuid[12], uuid[13], uuid[14], uuid[15]);
-
+    virUUIDFormat(uuid, uuidstr);
+    virBufferVSprintf(buf, "  <uuid>%s</uuid>\n", uuidstr);
     virBufferVSprintf(buf, "  <memory>%lu</memory>\n", privdom->info.maxMem);
     virBufferVSprintf(buf, "  <vcpu>%d</vcpu>\n", privdom->info.nrVirtCpu);
     virBufferVSprintf(buf, "  <on_reboot>%s</on_reboot>\n", testRestartFlagToString(privdom->onReboot));
@@ -1859,6 +1851,7 @@ static char *testNetworkDumpXML(virNetworkPtr network, int flags ATTRIBUTE_UNUSE
     virBufferPtr buf;
     char *xml;
     unsigned char *uuid;
+    char uuidstr[VIR_UUID_STRING_BUFLEN];
     GET_NETWORK(network, NULL);
 
     if (!(buf = virBufferNew(4000))) {
@@ -1869,13 +1862,8 @@ static char *testNetworkDumpXML(virNetworkPtr network, int flags ATTRIBUTE_UNUSE
     virBufferAdd(buf, "<network>\n", -1);
     virBufferVSprintf(buf, "  <name>%s</name>\n", network->name);
     uuid = network->uuid;
-    virBufferVSprintf(buf,
-                      "  <uuid>%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x</uuid>\n",
-                      uuid[0], uuid[1], uuid[2], uuid[3],
-                      uuid[4], uuid[5], uuid[6], uuid[7],
-                      uuid[8], uuid[9], uuid[10], uuid[11],
-                      uuid[12], uuid[13], uuid[14], uuid[15]);
-
+    virUUIDFormat(uuid, uuidstr);
+    virBufferVSprintf(buf, "  <uuid>%s</uuid>\n", uuidstr);
     virBufferVSprintf(buf, "  <bridge name='%s'/>\n", privnet->bridge);
     if (privnet->forward) {
         if (privnet->forwardDev[0])
index 6e1dbd7871dfeec40cf0944645415baaecdf211b..c00a1b5a7496c0b562a53ceb6c62e141cd7f5b9d 100644 (file)
@@ -79,7 +79,7 @@ virUUIDGeneratePseudoRandomBytes(unsigned char *buf,
 
 /**
  * virUUIDGenerate:
- * @uuid: array of VIR_UUID_RAW_LEN bytes to store the new UUID
+ * @uuid: array of VIR_UUID_BUFLEN bytes to store the new UUID
  *
  * Generates a randomized unique identifier.
  *
@@ -93,18 +93,18 @@ virUUIDGenerate(unsigned char *uuid)
     if (uuid == NULL)
         return(-1);
 
-    if ((err = virUUIDGenerateRandomBytes(uuid, VIR_UUID_RAW_LEN)))
+    if ((err = virUUIDGenerateRandomBytes(uuid, VIR_UUID_BUFLEN)))
         qemudLog(QEMUD_WARN,
                  "Falling back to pseudorandom UUID, "
                  "failed to generate random bytes: %s", strerror(err));
 
-    return virUUIDGeneratePseudoRandomBytes(uuid, VIR_UUID_RAW_LEN);
+    return virUUIDGeneratePseudoRandomBytes(uuid, VIR_UUID_BUFLEN);
 }
 
 /**
  * virUUIDParse:
- * @uuid: zero terminated string representation of the UUID
- * @rawuuid: array of VIR_UUID_RAW_LEN bytes to store the raw UUID
+ * @uuidstr: zero terminated string representation of the UUID
+ * @uuid: array of VIR_UUID_BUFLEN bytes to store the raw UUID
  *
  * Parses the external string representation, allowing spaces and '-'
  * character in the sequence, and storing the result as a raw UUID
@@ -112,20 +112,20 @@ virUUIDGenerate(unsigned char *uuid)
  * Returns 0 in case of success and -1 in case of error.
  */
 int
-virUUIDParse(const char *uuid, unsigned char *rawuuid) {
+virUUIDParse(const char *uuidstr, unsigned char *uuid) {
     const char *cur;
     int i;
 
-    if ((uuid == NULL) || (rawuuid == NULL))
+    if ((uuidstr == NULL) || (uuid == NULL))
         return(-1);
 
     /*
      * do a liberal scan allowing '-' and ' ' anywhere between character
      * pairs as long as there is 32 of them in the end.
      */
-    cur = uuid;
-    for (i = 0;i < 16;) {
-        rawuuid[i] = 0;
+    cur = uuidstr;
+    for (i = 0;i < VIR_UUID_BUFLEN;) {
+        uuid[i] = 0;
         if (*cur == 0)
             goto error;
         if ((*cur == '-') || (*cur == ' ')) {
@@ -133,23 +133,23 @@ virUUIDParse(const char *uuid, unsigned char *rawuuid) {
             continue;
         }
         if ((*cur >= '0') && (*cur <= '9'))
-            rawuuid[i] = *cur - '0';
+            uuid[i] = *cur - '0';
         else if ((*cur >= 'a') && (*cur <= 'f'))
-            rawuuid[i] = *cur - 'a' + 10;
+            uuid[i] = *cur - 'a' + 10;
         else if ((*cur >= 'A') && (*cur <= 'F'))
-            rawuuid[i] = *cur - 'A' + 10;
+            uuid[i] = *cur - 'A' + 10;
         else
             goto error;
-        rawuuid[i] *= 16;
+        uuid[i] *= 16;
         cur++;
         if (*cur == 0)
             goto error;
         if ((*cur >= '0') && (*cur <= '9'))
-            rawuuid[i] += *cur - '0';
+            uuid[i] += *cur - '0';
         else if ((*cur >= 'a') && (*cur <= 'f'))
-            rawuuid[i] += *cur - 'a' + 10;
+            uuid[i] += *cur - 'a' + 10;
         else if ((*cur >= 'A') && (*cur <= 'F'))
-            rawuuid[i] += *cur - 'A' + 10;
+            uuid[i] += *cur - 'A' + 10;
         else
             goto error;
         i++;
@@ -162,6 +162,29 @@ virUUIDParse(const char *uuid, unsigned char *rawuuid) {
     return -1;
 }
 
+/**
+ * virUUIDFormat:
+ * @uuid: array of VIR_UUID_RAW_LEN bytes to store the raw UUID
+ * @uuidstr: array of VIR_UUID_STRING_BUFLEN bytes to store the
+ * string representation of the UUID in. The resulting string
+ * will be NULL terminated.
+ *
+ * Converts the raw UUID into printable format, with embedded '-'
+ *
+ * Returns 0 in case of success and -1 in case of error.
+ */
+void virUUIDFormat(const unsigned char *uuid, char *uuidstr)
+{
+    snprintf(uuidstr, VIR_UUID_STRING_BUFLEN,
+             "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
+             uuid[0], uuid[1], uuid[2], uuid[3],
+             uuid[4], uuid[5], uuid[6], uuid[7],
+             uuid[8], uuid[9], uuid[10], uuid[11],
+             uuid[12], uuid[13], uuid[14], uuid[15]);
+    uuidstr[VIR_UUID_STRING_BUFLEN-1] = '\0';
+}
+
+
 /*
  * Local variables:
  *  indent-tabs-mode: nil
index 2584694d41c310db309cb6f3fd9dee1bcf480bfe..f1d7d028c65290eff60e93bd378a35d09d57c7b7 100644 (file)
 #ifndef __VIR_UUID_H__
 #define __VIR_UUID_H__
 
-/**
- * VIR_UUID_RAW_LEN:
- * number of bytes used by an UUID in raw form
- */
-#define VIR_UUID_RAW_LEN 16
-
 int virUUIDGenerate(unsigned char *uuid);
 
-int virUUIDParse(const char *uuid,
-                unsigned char *rawuuid);
+int virUUIDParse(const char *uuidstr,
+                unsigned char *uuid);
+
+void virUUIDFormat(const unsigned char *uuid,
+                  char *uuidstr);
 
 #endif /* __VIR_UUID_H__ */
index 2603f208ab61b8e538a23ce1fa43228a13f16869..020e29c04834712dfe0779830a4db009a79f5d54 100644 (file)
@@ -36,6 +36,7 @@
 #include "sexpr.h"
 #include "xml.h"
 #include "buf.h"
+#include "uuid.h"
 #include "xen_unified.h"
 #include "xend_internal.h"
 #include "xen_internal.h" /* for DOM0_INTERFACE_VERSION */
@@ -776,13 +777,15 @@ sexpr_u64(struct sexpr *sexpr, const char *name)
  *
  * convenience function to lookup an UUID value from the S-Expression
  *
- * Returns a pointer to the stored UUID or NULL in case of error.
+ * Returns a -1 on error, 0 on success
  */
-static unsigned char *
-sexpr_uuid(char **ptr, struct sexpr *node, const char *path)
+static int
+sexpr_uuid(unsigned char *ptr, struct sexpr *node, const char *path)
 {
     const char *r = sexpr_node(node, path);
-    return virParseUUID(ptr, r);
+    if (!r)
+        return -1;
+    return virUUIDParse(r, ptr);
 }
 
 
@@ -1061,10 +1064,7 @@ xenDaemonDomainLookupByName_ids(virConnectPtr xend, const char *domname,
                      _("domain information incorrect domid not numeric"));
         ret = -1;
     } else if (uuid != NULL) {
-        char *uuid_c = (char *) uuid;
-        char **ptr = &uuid_c;
-
-        if (sexpr_uuid(ptr, root, "domain/uuid") == NULL) {
+        if (sexpr_uuid(uuid, root, "domain/uuid") < 0) {
             virXendError(xend, VIR_ERR_INTERNAL_ERROR,
                          _("domain information incomplete, missing uuid"));
         }
@@ -1094,7 +1094,6 @@ xenDaemonDomainLookupByID(virConnectPtr xend,
                          unsigned char *uuid)
 {
     const char *name = NULL;
-    char *dst_uuid;
     struct sexpr *root;
 
     memset(uuid, 0, VIR_UUID_BUFLEN);
@@ -1112,8 +1111,7 @@ xenDaemonDomainLookupByID(virConnectPtr xend,
     if (domname)
       *domname = strdup(name);
 
-    dst_uuid = (char *)&uuid[0];
-    if (sexpr_uuid(&dst_uuid, root, "domain/uuid") == NULL) {
+    if (sexpr_uuid(uuid, root, "domain/uuid") < 0) {
       virXendError(xend, VIR_ERR_INTERNAL_ERROR,
                    _("domain information incomplete, missing uuid"));
       goto error;
@@ -1354,6 +1352,8 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root, int xendConfigVersi
     int hvm = 0, bootloader = 0;
     int domid = -1;
     int max_mem, cur_mem;
+    unsigned char uuid[VIR_UUID_BUFLEN];
+    char uuidstr[VIR_UUID_STRING_BUFLEN];
 
     if (root == NULL) {
         /* ERROR */
@@ -1386,21 +1386,15 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root, int xendConfigVersi
     }
     virBufferVSprintf(&buf, "  <name>%s</name>\n", tmp);
     tmp = sexpr_node(root, "domain/uuid");
-    if (tmp != NULL) {
-        char compact[33];
-       int i, j;
-       for (i = 0, j = 0;(i < 32) && (tmp[j] != 0);j++) {
-           if (((tmp[j] >= '0') && (tmp[j] <= '9')) ||
-               ((tmp[j] >= 'a') && (tmp[j] <= 'f'))) {
-            compact[i++] = tmp[j];
-        } else if ((tmp[j] >= 'A') && (tmp[j] <= 'F')) {
-               compact[i++] = tmp[j] + 'a' - 'A';
-        }
-       }
-       compact[i] = 0;
-       if (i > 0)
-           virBufferVSprintf(&buf, "  <uuid>%s</uuid>\n", compact);
+    if (tmp == NULL) {
+        virXendError(conn, VIR_ERR_INTERNAL_ERROR,
+                     _("domain information incomplete, missing name"));
+        goto error;
     }
+    virUUIDParse(tmp, uuid);
+    virUUIDFormat(uuid, uuidstr);
+    virBufferVSprintf(&buf, "  <uuid>%s</uuid>\n", uuidstr);
+
     tmp = sexpr_node(root, "domain/bootloader");
     if (tmp != NULL) {
         bootloader = 1;
@@ -1884,8 +1878,7 @@ static virDomainPtr
 sexpr_to_domain(virConnectPtr conn, struct sexpr *root)
 {
     virDomainPtr ret = NULL;
-    char *dst_uuid = NULL;
-    char uuid[VIR_UUID_BUFLEN];
+    unsigned char uuid[VIR_UUID_BUFLEN];
     const char *name;
     const char *tmp;
     xenUnifiedPrivatePtr priv;
@@ -1895,14 +1888,13 @@ sexpr_to_domain(virConnectPtr conn, struct sexpr *root)
 
     priv = (xenUnifiedPrivatePtr) conn->privateData;
 
-    dst_uuid = (char *) &uuid[0];
-    if (sexpr_uuid(&dst_uuid, root, "domain/uuid") == NULL)
+    if (sexpr_uuid(uuid, root, "domain/uuid") < 0)
         goto error;
     name = sexpr_node(root, "domain/name");
     if (name == NULL)
         goto error;
 
-    ret = virGetDomain(conn, name, (const unsigned char *) &uuid[0]);
+    ret = virGetDomain(conn, name, uuid);
     if (ret == NULL) return NULL;
 
     tmp = sexpr_node(root, "domain/domid");
@@ -2974,15 +2966,7 @@ xenDaemonLookupByUUID(virConnectPtr conn, const unsigned char *uuid)
         char uuidstr[VIR_UUID_STRING_BUFLEN];
         struct sexpr *root = NULL;
 
-        memset(uuidstr, '\0', VIR_UUID_STRING_BUFLEN);
-
-        snprintf(uuidstr, VIR_UUID_STRING_BUFLEN,
-                 "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
-                 uuid[0], uuid[1], uuid[2], uuid[3],
-                 uuid[4], uuid[5], uuid[6], uuid[7],
-                 uuid[8], uuid[9], uuid[10], uuid[11],
-                 uuid[12], uuid[13], uuid[14], uuid[15]);
-
+        virUUIDFormat(uuid, uuidstr);
         root = sexpr_get(conn, "/xend/domain/%s?detail=1", uuidstr);
         if (root == NULL)
             return (NULL);
index e559e4e47d833fd267c3e2860b6fd755df4c5217..5e807e4015709aaf2384964f2c0f658b89853592 100644 (file)
@@ -50,6 +50,7 @@
 #include "internal.h"
 #include "xml.h"
 #include "buf.h"
+#include "uuid.h"
 
 typedef struct xenXMConfCache *xenXMConfCachePtr;
 typedef struct xenXMConfCache {
@@ -200,7 +201,6 @@ static int xenXMConfigGetString(virConfPtr conf, const char *name, const char **
 /* Convenience method to grab a string UUID from the config file object */
 static int xenXMConfigGetUUID(virConfPtr conf, const char *name, unsigned char *uuid) {
     virConfValuePtr val;
-    char *rawuuid = (char *)uuid;
     if (!uuid || !name || !conf)
         return (-1);
     if (!(val = virConfGetValue(conf, name))) {
@@ -212,20 +212,12 @@ static int xenXMConfigGetUUID(virConfPtr conf, const char *name, unsigned char *
     if (!val->str)
         return (-1);
 
-    if (!virParseUUID(&rawuuid, val->str))
+    if (virUUIDParse(val->str, uuid) < 0)
         return (-1);
 
     return (0);
 }
 
-/* Generate a rnadom UUID - used if domain doesn't already
-   have one in its config */
-static void xenXMConfigGenerateUUID(unsigned char *uuid) {
-    int i;
-    for (i = 0 ; i < VIR_UUID_BUFLEN ; i++) {
-        uuid[i] = (unsigned char)(1 + (int) (256.0 * (rand() / (RAND_MAX + 1.0))));
-    }
-}
 
 /* Ensure that a config object has a valid UUID in it,
    if it doesn't then (re-)generate one */
@@ -263,14 +255,8 @@ static int xenXMConfigEnsureIdentity(virConfPtr conf, const char *filename) {
         }
 
         /* ... then generate one */
-        xenXMConfigGenerateUUID(uuid);
-        snprintf(uuidstr, VIR_UUID_STRING_BUFLEN,
-                 "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x</uuid>\n",
-                 uuid[0], uuid[1], uuid[2], uuid[3],
-                 uuid[4], uuid[5], uuid[6], uuid[7],
-                 uuid[8], uuid[9], uuid[10], uuid[11],
-                 uuid[12], uuid[13], uuid[14], uuid[15]);
-        uuidstr[VIR_UUID_STRING_BUFLEN-1] = '\0';
+        virUUIDGenerate(uuid);
+        virUUIDFormat(uuid, uuidstr);
 
         value->type = VIR_CONF_STRING;
         value->str = strdup(uuidstr);
@@ -587,6 +573,7 @@ char *xenXMDomainFormatXML(virConnectPtr conn, virConfPtr conf) {
     char *xml;
     const char *name;
     unsigned char uuid[VIR_UUID_BUFLEN];
+    char uuidstr[VIR_UUID_STRING_BUFLEN];
     const char *str;
     int hvm = 0;
     long val;
@@ -609,12 +596,8 @@ char *xenXMDomainFormatXML(virConnectPtr conn, virConfPtr conf) {
 
     virBufferAdd(buf, "<domain type='xen'>\n", -1);
     virBufferVSprintf(buf, "  <name>%s</name>\n", name);
-    virBufferVSprintf(buf,
-                      "  <uuid>%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x</uuid>\n",
-                      uuid[0], uuid[1], uuid[2], uuid[3],
-                      uuid[4], uuid[5], uuid[6], uuid[7],
-                      uuid[8], uuid[9], uuid[10], uuid[11],
-                      uuid[12], uuid[13], uuid[14], uuid[15]);
+    virUUIDFormat(uuid, uuidstr);
+    virBufferVSprintf(buf, "  <uuid>%s</uuid>\n", uuidstr);
 
     if ((xenXMConfigGetString(conf, "builder", &str) == 0) &&
         !strcmp(str, "hvm"))
index 571a2fc02f0c76305125590f43a8ea821949974c..1688dbdf9aa4bdab945731b1ac5b9382bb4244e0 100644 (file)
--- a/src/xml.c
+++ b/src/xml.c
@@ -1308,67 +1308,6 @@ virDomainParseXMLDesc(virConnectPtr conn, const char *xmldesc, char **name, int
     return (NULL);
 }
 
-#endif /* !PROXY */
-
-
-
-unsigned char *virParseUUID(char **ptr, const char *uuid) {
-    int rawuuid[VIR_UUID_BUFLEN];
-    const char *cur;
-    unsigned char *dst_uuid = NULL;
-    int i;
-
-    if (uuid == NULL)
-        goto error;
-
-    /*
-     * do a liberal scan allowing '-' and ' ' anywhere between character
-     * pairs as long as there is 32 of them in the end.
-     */
-    cur = uuid;
-    for (i = 0;i < VIR_UUID_BUFLEN;) {
-        rawuuid[i] = 0;
-        if (*cur == 0)
-            goto error;
-        if ((*cur == '-') || (*cur == ' ')) {
-            cur++;
-            continue;
-        }
-        if ((*cur >= '0') && (*cur <= '9'))
-            rawuuid[i] = *cur - '0';
-        else if ((*cur >= 'a') && (*cur <= 'f'))
-            rawuuid[i] = *cur - 'a' + 10;
-        else if ((*cur >= 'A') && (*cur <= 'F'))
-            rawuuid[i] = *cur - 'A' + 10;
-        else
-            goto error;
-        rawuuid[i] *= 16;
-        cur++;
-        if (*cur == 0)
-            goto error;
-        if ((*cur >= '0') && (*cur <= '9'))
-            rawuuid[i] += *cur - '0';
-        else if ((*cur >= 'a') && (*cur <= 'f'))
-            rawuuid[i] += *cur - 'a' + 10;
-        else if ((*cur >= 'A') && (*cur <= 'F'))
-            rawuuid[i] += *cur - 'A' + 10;
-        else
-            goto error;
-        i++;
-        cur++;
-    }
-
-    dst_uuid = (unsigned char *) *ptr;
-    *ptr += 16;
-
-    for (i = 0; i < VIR_UUID_BUFLEN; i++)
-        dst_uuid[i] = rawuuid[i] & 0xFF;
-
- error:
-    return(dst_uuid);
-}
-
-#ifndef PROXY
 /**
  * virParseXMLDevice:
  * @conn: pointer to the hypervisor connection
index a8c7b3cebcf6439903f75ff4584e9a9fd15d6d48..29ccd58c05d4a7595867afaeaf51958aaf9b5450 100644 (file)
--- a/src/xml.h
+++ b/src/xml.h
@@ -32,7 +32,6 @@ int           virXPathNodeSet (const char *xpath,
                                 xmlNodePtr **list);
 
 char *virDomainParseXMLDesc(virConnectPtr conn, const char *xmldesc, char **name, int xendConfigVersion);
-unsigned char *virParseUUID(char **ptr, const char *uuid);
 char *virParseXMLDevice(virConnectPtr conn, char *xmldesc, int hvm, int xendConfigVersion);
 int virDomainXMLDevID(virDomainPtr domain, char *xmldesc, char *class, char *ref);
 
index d8f662d49dbe30368c9c2e9675a4c750261a99d5..8c46e18a84a928467367545dfbd6dcee328f4833 100644 (file)
@@ -1,6 +1,6 @@
 <domain type='xen' id='5'>
   <name>rhel5</name>
-  <uuid>4f77abd2301958e83bab6fbf2118f880</uuid>
+  <uuid>4f77abd2-3019-58e8-3bab-6fbf2118f880</uuid>
   <bootloader>/usr/bin/pygrub</bootloader>
   <os>
     <type>linux</type>
index 60cf44c45ccba39ba1f8a72e564e993ba4894a15..a6d54661a11ef4e98833b4d933810a2bb53c74fe 100644 (file)
@@ -1,6 +1,6 @@
 <domain type='xen' id='6'>
   <name>pvtest</name>
-  <uuid>596a5d2171f48fb2e068e2386a5c413e</uuid>
+  <uuid>596a5d21-71f4-8fb2-e068-e2386a5c413e</uuid>
   <os>
     <type>linux</type>
     <kernel>/var/lib/xen/vmlinuz.2Dn2YT</kernel>
index f0322b437966c869c31b2dd36919290261fc05a3..af2ae7b2547061a591a0d17d4e0ff605ba417d63 100644 (file)
@@ -1,6 +1,6 @@
 <domain type='xen' id='6'>
   <name>pvtest</name>
-  <uuid>596a5d2171f48fb2e068e2386a5c413e</uuid>
+  <uuid>596a5d21-71f4-8fb2-e068-e2386a5c413e</uuid>
   <os>
     <type>linux</type>
     <kernel>/var/lib/xen/vmlinuz.2Dn2YT</kernel>
index 5e8c09a46956ac4f31e5b0c8d7e7f838522cd7ff..1cb4a3978e338ffc09b3d9c3d84bb2f9d1460f68 100644 (file)
@@ -1,6 +1,6 @@
 <domain type='xen' id='6'>
   <name>pvtest</name>
-  <uuid>596a5d2171f48fb2e068e2386a5c413e</uuid>
+  <uuid>596a5d21-71f4-8fb2-e068-e2386a5c413e</uuid>
   <os>
     <type>linux</type>
     <kernel>/var/lib/xen/vmlinuz.2Dn2YT</kernel>
index 8197a8ed4ea42a1b3a73ff5b645dd23077c51973..8c3603647e1aa9f8a9725ae704cfe06d484b2281 100644 (file)
@@ -1,6 +1,6 @@
 <domain type='xen' id='6'>
   <name>pvtest</name>
-  <uuid>596a5d2171f48fb2e068e2386a5c413e</uuid>
+  <uuid>596a5d21-71f4-8fb2-e068-e2386a5c413e</uuid>
   <os>
     <type>linux</type>
     <kernel>/var/lib/xen/vmlinuz.2Dn2YT</kernel>
index 4b58de74ec1d4a3b1ca2ef5705fb6d3bb7069085..a6ebc1a468c2abe6a82574a97d65dd99ba7789dd 100644 (file)
@@ -1,6 +1,6 @@
 <domain type='xen' id='3'>
   <name>fvtest</name>
-  <uuid>b5d70dd275cdaca517769660b059d8bc</uuid>
+  <uuid>b5d70dd2-75cd-aca5-1776-9660b059d8bc</uuid>
   <os>
     <type>hvm</type>
     <loader>/usr/lib/xen/boot/hvmloader</loader>
index e96ecfab5c450f6383151e30a6f0a01210e69b60..4b9e1e4dfc329a60efd15c43f6b15a98371cb3ce 100644 (file)
@@ -1,6 +1,6 @@
 <domain type='xen' id='3'>
   <name>fvtest</name>
-  <uuid>b5d70dd275cdaca517769660b059d8bc</uuid>
+  <uuid>b5d70dd2-75cd-aca5-1776-9660b059d8bc</uuid>
   <os>
     <type>hvm</type>
     <loader>/usr/lib/xen/boot/hvmloader</loader>
index 235583c606901fce882ecbde8e626613d3ebd916..5567e19196b51a3ab0460685e284f98dc2a76b86 100644 (file)
@@ -1,6 +1,6 @@
 <domain type='xen' id='3'>
   <name>fvtest</name>
-  <uuid>b5d70dd275cdaca517769660b059d8bc</uuid>
+  <uuid>b5d70dd2-75cd-aca5-1776-9660b059d8bc</uuid>
   <os>
     <type>hvm</type>
     <loader>/usr/lib/xen/boot/hvmloader</loader>
index 700c957c8aec54e4fab48e5ef8b98db233e390f6..0382a69f5be9bbf31c90f58fc3ced1616453935c 100644 (file)
@@ -1,6 +1,6 @@
 <domain type='xen' id='3'>
   <name>fvtest</name>
-  <uuid>b5d70dd275cdaca517769660b059d8bc</uuid>
+  <uuid>b5d70dd2-75cd-aca5-1776-9660b059d8bc</uuid>
   <os>
     <type>hvm</type>
     <loader>/usr/lib/xen/boot/hvmloader</loader>
index b9a873fe655bd7fe43ac0b05fde49d569a897ca0..8a89770b2ceb39c6e3217a0de714495a97ce9e64 100644 (file)
@@ -1,6 +1,6 @@
 <domain type='xen' id='3'>
   <name>fvtest</name>
-  <uuid>b5d70dd275cdaca517769660b059d8bc</uuid>
+  <uuid>b5d70dd2-75cd-aca5-1776-9660b059d8bc</uuid>
   <os>
     <type>hvm</type>
     <loader>/usr/lib/xen/boot/hvmloader</loader>
index 700c957c8aec54e4fab48e5ef8b98db233e390f6..0382a69f5be9bbf31c90f58fc3ced1616453935c 100644 (file)
@@ -1,6 +1,6 @@
 <domain type='xen' id='3'>
   <name>fvtest</name>
-  <uuid>b5d70dd275cdaca517769660b059d8bc</uuid>
+  <uuid>b5d70dd2-75cd-aca5-1776-9660b059d8bc</uuid>
   <os>
     <type>hvm</type>
     <loader>/usr/lib/xen/boot/hvmloader</loader>
index 9ff80f40a67f1fe42100f115a885aadad94ed75c..4eb2d186f48c2024a6ac9c9f293f97d9f530351d 100644 (file)
@@ -1,6 +1,6 @@
 <domain type='xen' id='6'>
   <name>pvtest</name>
-  <uuid>596a5d2171f48fb2e068e2386a5c413e</uuid>
+  <uuid>596a5d21-71f4-8fb2-e068-e2386a5c413e</uuid>
   <os>
     <type>linux</type>
     <kernel>/var/lib/xen/vmlinuz.2Dn2YT</kernel>
index a0ede8a48a29c903e58d12f5440ff17e5b1ad84c..f1a12f63d272c9d85825c5fde25c84b3d5a01970 100644 (file)
@@ -1,6 +1,6 @@
 <domain type='xen' id='6'>
   <name>pvtest</name>
-  <uuid>596a5d2171f48fb2e068e2386a5c413e</uuid>
+  <uuid>596a5d21-71f4-8fb2-e068-e2386a5c413e</uuid>
   <os>
     <type>linux</type>
     <kernel>/var/lib/xen/vmlinuz.2Dn2YT</kernel>
index e51311a1898b7617291d743fa4e8de304583db87..ea77f57cfd2a5c6d08d0e53f91fbee8ac8a487f0 100644 (file)
@@ -1,6 +1,6 @@
 <domain type='xen' id='6'>
   <name>test</name>
-  <uuid>cc2315e7d26a307a438c6d188ec4c09c</uuid>
+  <uuid>cc2315e7-d26a-307a-438c-6d188ec4c09c</uuid>
   <os>
     <type>hvm</type>
     <loader>/usr/lib/xen/boot/hvmloader</loader>
index 221832dbc0a6d2e96bfb170224f3cdab07880be9..9ee542dd4729843e698f5c953760ec7ab14d2b8e 100644 (file)
@@ -1,6 +1,6 @@
 <domain type='xen' id='6'>
   <name>pvtest</name>
-  <uuid>596a5d2171f48fb2e068e2386a5c413e</uuid>
+  <uuid>596a5d21-71f4-8fb2-e068-e2386a5c413e</uuid>
   <bootloader>/usr/bin/pypxeboot</bootloader>
   <bootloader_args>mac=AA:00:86:e2:35:72</bootloader_args>
   <memory>430080</memory>
index 2fae25f864da41aeaed6b1a02c92dceef24a16cd..a8b61eb5c9cad23da3f0b5c3ce394ab92daa5d7a 100644 (file)
@@ -1,6 +1,6 @@
 <domain type='xen' id='6'>
   <name>pvtest</name>
-  <uuid>596a5d2171f48fb2e068e2386a5c413e</uuid>
+  <uuid>596a5d21-71f4-8fb2-e068-e2386a5c413e</uuid>
   <os>
     <type>linux</type>
     <kernel>/var/lib/xen/vmlinuz.2Dn2YT</kernel>
index 2fae25f864da41aeaed6b1a02c92dceef24a16cd..a8b61eb5c9cad23da3f0b5c3ce394ab92daa5d7a 100644 (file)
@@ -1,6 +1,6 @@
 <domain type='xen' id='6'>
   <name>pvtest</name>
-  <uuid>596a5d2171f48fb2e068e2386a5c413e</uuid>
+  <uuid>596a5d21-71f4-8fb2-e068-e2386a5c413e</uuid>
   <os>
     <type>linux</type>
     <kernel>/var/lib/xen/vmlinuz.2Dn2YT</kernel>
index 8197a8ed4ea42a1b3a73ff5b645dd23077c51973..8c3603647e1aa9f8a9725ae704cfe06d484b2281 100644 (file)
@@ -1,6 +1,6 @@
 <domain type='xen' id='6'>
   <name>pvtest</name>
-  <uuid>596a5d2171f48fb2e068e2386a5c413e</uuid>
+  <uuid>596a5d21-71f4-8fb2-e068-e2386a5c413e</uuid>
   <os>
     <type>linux</type>
     <kernel>/var/lib/xen/vmlinuz.2Dn2YT</kernel>
index 56747ce726f864168960b44943e3f51f886bcf62..18165a542689390473072547de7be09d13429fc3 100755 (executable)
@@ -1,5 +1,5 @@
 name = "XenGuest2"
-uuid = "c7a5fdb2cdaf9455926ad65c16db1809"
+uuid = "c7a5fdb2-cdaf-9455-926a-d65c16db1809"
 maxmem = 579
 memory = 394
 vcpus = 1
index 211f29f09820343d2ea36058e076730fc133223f..3a3aa56457d6efda7b5fb01b965d57efed57ed34 100644 (file)
@@ -1,6 +1,6 @@
 <domain type='xen'>
   <name>XenGuest2</name>
-  <uuid>c7a5fdb2cdaf9455926ad65c16db1809</uuid>
+  <uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
   <os>
     <type>hvm</type>
     <loader>/usr/lib/xen/boot/hvmloader</loader>
index 7c158b333151be9f0274b8b1d09b0ac03a857b73..2777535d1898d31c915fa1e6681521bf8da0f57a 100755 (executable)
@@ -1,5 +1,5 @@
 name = "XenGuest2"
-uuid = "c7a5fdb2cdaf9455926ad65c16db1809"
+uuid = "c7a5fdb2-cdaf-9455-926a-d65c16db1809"
 maxmem = 579
 memory = 394
 vcpus = 1
index 836ee4532b3f7beea7514bf29075ca3b162fc93a..4d60e66f7644bf95721e8109a4e677e5f1c6412c 100644 (file)
@@ -1,6 +1,6 @@
 <domain type='xen'>
   <name>XenGuest2</name>
-  <uuid>c7a5fdb2cdaf9455926ad65c16db1809</uuid>
+  <uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
   <os>
     <type>hvm</type>
     <loader>/usr/lib/xen/boot/hvmloader</loader>
index f84dab50200211a5007bcedb7ddd99665dc11705..2f2cc361f595bf41c84e2a533e053132bd185abd 100755 (executable)
@@ -1,5 +1,5 @@
 name = "XenGuest2"
-uuid = "c7a5fdb2cdaf9455926ad65c16db1809"
+uuid = "c7a5fdb2-cdaf-9455-926a-d65c16db1809"
 maxmem = 579
 memory = 394
 vcpus = 1
index 36b98a06b61a1bc5e1845d3f70e35a7213b05ea9..e6c1d5958a948acfa2ecfa361657086019ba8706 100644 (file)
@@ -1,6 +1,6 @@
 <domain type='xen'>
   <name>XenGuest2</name>
-  <uuid>c7a5fdb2cdaf9455926ad65c16db1809</uuid>
+  <uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
   <os>
     <type>hvm</type>
     <loader>/usr/lib/xen/boot/hvmloader</loader>
index abbef2b7906d6b40bc15a6f56b1a25e8049bbaea..b4e5f9b600beca5221f1dbad1e85c84a5b1136ee 100755 (executable)
@@ -1,5 +1,5 @@
 name = "XenGuest2"
-uuid = "c7a5fdb2cdaf9455926ad65c16db1809"
+uuid = "c7a5fdb2-cdaf-9455-926a-d65c16db1809"
 maxmem = 579
 memory = 394
 vcpus = 1
index 0433a955ac7b13460dc4a9936ba4817456cdd121..a0eea9e974a17c9c3abf2a35d278e8cda9d3f97c 100644 (file)
@@ -1,6 +1,6 @@
 <domain type='xen'>
   <name>XenGuest2</name>
-  <uuid>c7a5fdb2cdaf9455926ad65c16db1809</uuid>
+  <uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
   <os>
     <type>hvm</type>
     <loader>/usr/lib/xen/boot/hvmloader</loader>
index 99e17b888b0ad55c69eee94c14d805653cf899c5..db0ae380ddc18bf5c05af732c8defa9ae2605c23 100644 (file)
@@ -1,6 +1,6 @@
 <domain type='xen'>
   <name>XenGuest2</name>
-  <uuid>c7a5fdb2cdaf9455926ad65c16db1809</uuid>
+  <uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
   <os>
     <type>hvm</type>
     <loader>/usr/lib/xen/boot/hvmloader</loader>
index e29507b327ffd424ed7c23202007940a1aa5a3c7..fa10c9aa813ae55ad22ead882e836f7ce669a5f2 100755 (executable)
@@ -1,5 +1,5 @@
 name = "XenGuest2"
-uuid = "c7a5fdb2cdaf9455926ad65c16db1809"
+uuid = "c7a5fdb2-cdaf-9455-926a-d65c16db1809"
 maxmem = 579
 memory = 394
 vcpus = 1
index 7513935dc184b4622083305344d85cc03da84a42..7dcb1e56bbb9350d1d1e9410d60133cdea5e1bc4 100644 (file)
@@ -1,6 +1,6 @@
 <domain type='xen'>
   <name>XenGuest2</name>
-  <uuid>c7a5fdb2cdaf9455926ad65c16db1809</uuid>
+  <uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
   <os>
     <type>hvm</type>
     <loader>/usr/lib/xen/boot/hvmloader</loader>
index 7c158b333151be9f0274b8b1d09b0ac03a857b73..2777535d1898d31c915fa1e6681521bf8da0f57a 100755 (executable)
@@ -1,5 +1,5 @@
 name = "XenGuest2"
-uuid = "c7a5fdb2cdaf9455926ad65c16db1809"
+uuid = "c7a5fdb2-cdaf-9455-926a-d65c16db1809"
 maxmem = 579
 memory = 394
 vcpus = 1
index 836ee4532b3f7beea7514bf29075ca3b162fc93a..4d60e66f7644bf95721e8109a4e677e5f1c6412c 100644 (file)
@@ -1,6 +1,6 @@
 <domain type='xen'>
   <name>XenGuest2</name>
-  <uuid>c7a5fdb2cdaf9455926ad65c16db1809</uuid>
+  <uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
   <os>
     <type>hvm</type>
     <loader>/usr/lib/xen/boot/hvmloader</loader>
index 0d71266a8de24d3d774270c4862a3a1c3b2c3d15..76a6eae1ad321645efd55ef083fab1d60b3440cc 100755 (executable)
@@ -1,5 +1,5 @@
 name = "XenGuest1"
-uuid = "c7a5fdb0cdaf9455926ad65c16db1809"
+uuid = "c7a5fdb0-cdaf-9455-926a-d65c16db1809"
 maxmem = 579
 memory = 394
 vcpus = 1
index 4774cb337c27253ab84402aa5401826e88f5be89..72a07f56ae59e9fa06c6e72f5b5fac72dfdec262 100644 (file)
@@ -1,6 +1,6 @@
 <domain type='xen'>
   <name>XenGuest1</name>
-  <uuid>c7a5fdb0cdaf9455926ad65c16db1809</uuid>
+  <uuid>c7a5fdb0-cdaf-9455-926a-d65c16db1809</uuid>
   <bootloader>/usr/bin/pygrub</bootloader>
   <currentMemory>403456</currentMemory>
   <memory>592896</memory>
index fb112a103dfa1d8c29f9a476d7e05869e9e3349f..f37b28680d57751b8509fd8c9f18732433e63bf8 100755 (executable)
@@ -1,5 +1,5 @@
 name = "XenGuest1"
-uuid = "c7a5fdb0cdaf9455926ad65c16db1809"
+uuid = "c7a5fdb0-cdaf-9455-926a-d65c16db1809"
 maxmem = 579
 memory = 394
 vcpus = 1
index 4774cb337c27253ab84402aa5401826e88f5be89..72a07f56ae59e9fa06c6e72f5b5fac72dfdec262 100644 (file)
@@ -1,6 +1,6 @@
 <domain type='xen'>
   <name>XenGuest1</name>
-  <uuid>c7a5fdb0cdaf9455926ad65c16db1809</uuid>
+  <uuid>c7a5fdb0-cdaf-9455-926a-d65c16db1809</uuid>
   <bootloader>/usr/bin/pygrub</bootloader>
   <currentMemory>403456</currentMemory>
   <memory>592896</memory>