aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl.c
diff options
context:
space:
mode:
authorGianni Tedesco <gianni.tedesco@citrix.com>2010-09-02 18:12:14 +0100
committerGianni Tedesco <gianni.tedesco@citrix.com>2010-09-02 18:12:14 +0100
commit785684b4fddbd683763530a974ac822a01522794 (patch)
treee83410c7e87f9b4329d5c79acfbe1a82c7b0884a /tools/libxl/libxl.c
parent7497632508eb0574bccb5418339ceb38131dae2f (diff)
downloadxen-785684b4fddbd683763530a974ac822a01522794.tar.gz
xen-785684b4fddbd683763530a974ac822a01522794.tar.bz2
xen-785684b4fddbd683763530a974ac822a01522794.zip
xl: randomly generate UUIDs
This patch converts xl to randomly generate UUID's rather than using a dodgy time-seeded PRNG. I have ignored various suggestions so far on auto-generation of MAC addresses and left it as a topic for a future patch to solve. In other words the behaviour stays the same it's just using a true random source. This patch also implements the "uuid" config file parameter in xl. Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com> Acked-By: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxl/libxl.c')
-rw-r--r--tools/libxl/libxl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 03d4f313e1..03d9a9380c 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -131,7 +131,7 @@ int libxl_domain_make(libxl_ctx *ctx, libxl_domain_create_info *info,
*domid = -1;
/* Ultimately, handle is an array of 16 uint8_t, same as uuid */
- memcpy(handle, info->uuid, sizeof(xen_domain_handle_t));
+ libxl_uuid_copy((libxl_uuid *)handle, &info->uuid);
ret = xc_domain_create(ctx->xch, info->ssidref, handle, flags, domid);
if (ret < 0) {
@@ -1506,8 +1506,8 @@ static int libxl_create_stubdom(libxl_ctx *ctx,
memset(&c_info, 0x00, sizeof(libxl_domain_create_info));
c_info.hvm = 0;
c_info.name = libxl_sprintf(&gc, "%s-dm", _libxl_domid_to_name(&gc, info->domid));
- for (i = 0; i < 16; i++)
- c_info.uuid[i] = info->uuid[i];
+
+ libxl_uuid_copy(&c_info.uuid, &info->uuid);
memset(&b_info, 0x00, sizeof(libxl_domain_build_info));
b_info.max_vcpus = 1;