[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] fix rename: xenstore not fully updated
commit 412f0e6401d9d87298b9bba3bfbe8ec899429a2c Author: Chunyan Liu <cyliu@xxxxxxxx> AuthorDate: Wed Nov 19 14:34:11 2014 +0800 Commit: Ian Campbell <ian.campbell@xxxxxxxxxx> CommitDate: Fri Nov 28 11:22:13 2014 +0000 fix rename: xenstore not fully updated libxl__domain_rename only updates /local/domain/<domid>/name, /vm/<uuid>/name in xenstore are not updated. Add code in libxl__domain_rename to update /vm/<uuid>/name too. Signed-off-by: Chunyan Liu <cyliu@xxxxxxxx> Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> --- tools/libxl/libxl.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index bdecfb2..f84f7c2 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -359,6 +359,9 @@ int libxl__domain_rename(libxl__gc *gc, uint32_t domid, uint32_t stub_dm_domid; const char *stub_dm_old_name = NULL, *stub_dm_new_name = NULL; int rc; + libxl_dominfo info; + char *uuid; + const char *vm_name_path; dom_path = libxl__xs_get_dompath(gc, domid); if (!dom_path) goto x_nomem; @@ -429,6 +432,16 @@ int libxl__domain_rename(libxl__gc *gc, uint32_t domid, goto x_fail; } + /* update /vm/<uuid>/name */ + rc = libxl_domain_info(ctx, &info, domid); + if (rc) + goto x_fail; + + uuid = GCSPRINTF(LIBXL_UUID_FMT, LIBXL_UUID_BYTES(info.uuid)); + vm_name_path = GCSPRINTF("/vm/%s/name", uuid); + if (libxl__xs_write_checked(gc, trans, vm_name_path, new_name)) + goto x_fail; + if (stub_dm_domid) { rc = libxl__domain_rename(gc, stub_dm_domid, stub_dm_old_name, -- generated by git-patchbot for /home/xen/git/xen.git#master _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |