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

[Xen-changelog] [xen-unstable] xl: Add function to generate random uuid

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xl: Add function to generate random uuid and use it.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 28 Jul 2010 04:55:18 -0700
Delivery-date: Wed, 28 Jul 2010 04:58:02 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1280246354 -3600
# Node ID 1e140e894a34c03d0e18eef35712b59e01bafa7e
# Parent  c7af12b752ca9c445d1c69a52de94db0cf7b8dc8
xl: Add function to generate random uuid and use it.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 tools/libxl/xl_cmdimpl.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff -r c7af12b752ca -r 1e140e894a34 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Tue Jul 27 16:58:51 2010 +0100
+++ b/tools/libxl/xl_cmdimpl.c  Tue Jul 27 16:59:14 2010 +0100
@@ -211,15 +211,19 @@ static void init_build_info(libxl_domain
     }
 }
 
+static void random_uuid(uint8_t *uuid)
+{
+    int i;
+    for (i = 0; i < 16; i++)
+        uuid[i] = rand();
+}
+
 static void init_dm_info(libxl_device_model_info *dm_info,
         libxl_domain_create_info *c_info, libxl_domain_build_info *b_info)
 {
-    int i;
     memset(dm_info, '\0', sizeof(*dm_info));
 
-    for (i = 0; i < 16; i++) {
-        dm_info->uuid[i] = rand();
-    }
+    random_uuid(&dm_info->uuid[0]);
 
     dm_info->dom_name = c_info->name;
     dm_info->device_model = "qemu-dm";
@@ -493,7 +497,7 @@ static void parse_config_data(const char
     XLU_ConfigList *vbds, *nics, *pcis, *cvfbs, *net2s;
     int pci_power_mgmt = 0;
     int pci_msitranslate = 1;
-    int i, e;
+    int e;
 
     config= xlu_cfg_init(stderr, configfile_filename_report);
     if (!config) {
@@ -521,9 +525,7 @@ static void parse_config_data(const char
         c_info->name = strdup(buf);
     else
         c_info->name = "test";
-    for (i = 0; i < 16; i++) {
-        c_info->uuid[i] = rand();
-    }
+    random_uuid(&c_info->uuid[0]);
 
     if (!xlu_cfg_get_long(config, "oos", &l))
         c_info->oos = l;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xl: Add function to generate random uuid and use it., Xen patchbot-unstable <=