xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xensource.com
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [PATCH 5 of 9] xl: Add function to generate random uuid and use it
Date: Tue, 27 Jul 2010 11:13:47 +0100	[thread overview]
Message-ID: <a31105a3eb9d57d03711.1280225627@localhost.localdomain> (raw)
In-Reply-To: <patchbomb.1280225622@localhost.localdomain>

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1280225498 -3600
# Node ID a31105a3eb9d57d03711254bc2142b699cb1c146
# Parent  4e16c19ba1ac7a496198bed29e91a826e4691533
xl: Add function to generate random uuid and use it.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r 4e16c19ba1ac -r a31105a3eb9d tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Tue Jul 27 11:11:38 2010 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Tue Jul 27 11:11:38 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;

  parent reply	other threads:[~2010-07-27 10:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-27 10:13 [PATCH 0 of 9] xl: handle domain shutdown/reboot/crash in a user configurable way Ian Campbell
2010-07-27 10:13 ` [PATCH 1 of 9] libxl: Add LIBXL_EVENT namespace to enum libxl_event_type Ian Campbell
2010-07-27 10:13 ` [PATCH 2 of 9] libxl: add shutdown reason to libxl_dominfo Ian Campbell
2010-07-27 10:13 ` [PATCH 3 of 9] libxl: return libxl_dominfo from libxl_event_get_domain_death_info Ian Campbell
2010-07-27 10:13 ` [PATCH 4 of 9] libxl: signal caller if domain already destroyed on domain death event Ian Campbell
2010-07-27 10:13 ` Ian Campbell [this message]
2010-07-27 11:47   ` [PATCH 5 of 9] xl: Add function to generate random uuid and use it Gianni Tedesco
2010-07-27 16:02     ` Ian Jackson
2010-07-27 16:07       ` Ian Campbell
2010-07-27 10:13 ` [PATCH 6 of 9] xl: Factor out domain death handling into a separate function Ian Campbell
2010-07-27 10:13 ` [PATCH 7 of 9] xl: support on_{poweroff, reboot, crash} domain configuration options Ian Campbell
2010-07-27 10:13 ` [PATCH 8 of 9] libxl: add libxl_domain_preserve Ian Campbell
2010-07-27 10:13 ` [PATCH 9 of 9] xl: implement "rename-restart" action for shutdown Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a31105a3eb9d57d03711.1280225627@localhost.localdomain \
    --to=ian.campbell@citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).