All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chunyan Liu <cyliu@suse.com>
To: xen-devel@lists.xen.org
Cc: ian.jackson@eu.citrix.com, wei.liu2@citrix.com,
	ian.campbell@citrix.com, Chunyan Liu <cyliu@suse.com>
Subject: [PATCH 2/2 V3] fix rename: xenstore not fully updated
Date: Wed, 19 Nov 2014 14:34:11 +0800	[thread overview]
Message-ID: <1416378851-32236-3-git-send-email-cyliu@suse.com> (raw)
In-Reply-To: <1416378851-32236-1-git-send-email-cyliu@suse.com>

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@suse.com>
---
 tools/libxl/libxl.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index dbefaf3..b403edc 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,
-- 
1.8.4.5

  parent reply	other threads:[~2014-11-19  6:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-19  6:34 [PATCH 0/2 V3] fix rename: xenstore not fully updated Chunyan Liu
2014-11-19  6:34 ` [PATCH 1/2 V3] remove domain field in xenstore backend dir Chunyan Liu
2014-11-19 11:11   ` Ian Jackson
2014-11-19  6:34 ` Chunyan Liu [this message]
2014-11-19 11:12   ` [PATCH 2/2 V3] fix rename: xenstore not fully updated Ian Jackson
2014-11-19 11:26 ` [PATCH 0/2 " Ian Jackson
2014-11-19 21:25   ` Konrad Rzeszutek Wilk
2014-11-20 15:28     ` Ian Campbell
2014-11-21 17:01       ` Konrad Rzeszutek Wilk
2014-11-25 14:13         ` Ian Campbell
2014-11-25 15:51           ` Konrad Rzeszutek Wilk
2014-11-25 15:58             ` Ian Campbell
2014-11-25 16:03               ` Konrad Rzeszutek Wilk
2014-11-28 12:11                 ` 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=1416378851-32236-3-git-send-email-cyliu@suse.com \
    --to=cyliu@suse.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.