From: Ian Campbell Date: Tue, 7 Sep 2010 17:55:07 +0000 (+0100) Subject: libxl: include domain id in userdata path. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~11534 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4a993251f0a5d38e3ed90fa18533c99063bf576c;p=xen.git 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 etc. Signed-off-by: Ian Campbell Acked-by: Ian Jackson Signed-off-by: Ian Jackson --- diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c index e83bbbf20b..d9781e7060 100644 --- a/tools/libxl/libxl_dom.c +++ b/tools/libxl/libxl_dom.c @@ -466,8 +466,8 @@ static const char *userdata_path(libxl_gc *gc, uint32_t domid, uuid_string = libxl_sprintf(gc, LIBXL_UUID_FMT, LIBXL_UUID_BYTES(info.uuid)); 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");