[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Fix domain names that xentop shows



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1211787463 -3600
# Node ID 57923ddaacb96e0b4dc0cc2203ca5bee79a829a3
# Parent  3544f12d22b2fa723154ec089cbb7ca1f46407cb
Fix domain names that xentop shows

When I changed the name of a domain by using xm rename command, the
name of the domain that xentop shows did not change.  This patch
reflects new domain name to the name of domains that xentop shows.

Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
---
 tools/xenstat/libxenstat/src/xenstat.c |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff -r 3544f12d22b2 -r 57923ddaacb9 tools/xenstat/libxenstat/src/xenstat.c
--- a/tools/xenstat/libxenstat/src/xenstat.c    Mon May 26 08:27:19 2008 +0100
+++ b/tools/xenstat/libxenstat/src/xenstat.c    Mon May 26 08:37:43 2008 +0100
@@ -655,12 +655,20 @@ unsigned long long xenstat_vbd_wr_reqs(x
 
 static char *xenstat_get_domain_name(xenstat_handle *handle, unsigned int 
domain_id)
 {
-       char path[80];
-
-       snprintf(path, sizeof(path),"/local/domain/%i/name", domain_id);
-       
+       char path[80], *vmpath;
+
+       snprintf(path, sizeof(path),"/local/domain/%i/vm", domain_id);
+
+       vmpath = xs_read(handle->xshandle, XBT_NULL, path, NULL);
+
+       if (vmpath == NULL)
+               return NULL;
+
+       snprintf(path, sizeof(path),"%s/name", vmpath);
+       free(vmpath);
+
        return xs_read(handle->xshandle, XBT_NULL, path, NULL);
-}      
+}
 
 /* Remove specified entry from list of domains */
 static void xenstat_prune_domain(xenstat_node *node, unsigned int entry)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.