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/
Home Products Support Community News


Re: [Xen-devel] [PATCH,v7]: xl: randomly generate UUID's

To: Gianni Tedesco <gianni.tedesco@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH,v7]: xl: randomly generate UUID's
From: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Date: Mon, 6 Sep 2010 10:54:30 +0100
Cc: Christoph Egger <Christoph.Egger@xxxxxxx>, Xen Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>, Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>
Delivery-date: Mon, 06 Sep 2010 02:55:35 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1283437746.20276.65.camel@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: Citrix Systems, Inc.
References: <1283437746.20276.65.camel@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
This seems to have exposed a bug in the userdata scheme which breaks
localhost live migration. Attempted fix is below. I'm a little bit
concerned that it might expose leaks or other occasions where we loose
track of userdata but I think it is correct.


# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1283766752 -3600
# Node ID 75449758ea76cc3fd75a906ba827c51d10e62428
# Parent  a4b74331bed1aa2ebec68af2a2d9306d7d41986f
libxl: include domain id in userdata path.

The userdata is specific to a particular incarnation of a domain and
the patch is therefor required to be unique to each incarnation. If
the user has explicitly configured a UUID in their domain
configuration then the path is no longer unique since
22124:22366e13f76d "xl: randomly generate UUIDs" which (correctly)
caused the uuid domain configuration option to be obeyed.

If userdata is not unique to each incarnation of a domain then
localhost live migration is broken because the target is created (and
writes its userdata) before the sender destroys the domain (and
deletes its userdata).

Strictly speaking I think the UUID is unnecessary but it is perhaps
helpful to people looking in the userdata directory, for debugging

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

diff -r a4b74331bed1 -r 75449758ea76 tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c   Mon Sep 06 10:47:31 2010 +0100
+++ b/tools/libxl/libxl_dom.c   Mon Sep 06 10:52:32 2010 +0100
@@ -466,8 +466,8 @@ static const char *userdata_path(libxl_g
     uuid_string = libxl_sprintf(gc, LIBXL_UUID_FMT, 
     path = libxl_sprintf(gc, "/var/lib/xen/"
-                         "userdata-%s.%s.%s",
-                         wh, uuid_string, userdata_userid);
+                         "userdata-%s.%u.%s.%s",
+                         wh, domid, uuid_string, userdata_userid);
     if (!path)
         XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "unable to allocate for"
                      " userdata path");

Xen-devel mailing list