diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-05-26 08:37:43 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-05-26 08:37:43 +0100 |
commit | d91702d514466fec42323d9e5f1fc4161073b74f (patch) | |
tree | 7ca7f795b700bee26482a2ddac71a5ea5c8069d7 | |
parent | 7ff0fc519dea69691b2c6805a5946f9a1b11735b (diff) | |
download | xen-d91702d514466fec42323d9e5f1fc4161073b74f.tar.gz xen-d91702d514466fec42323d9e5f1fc4161073b74f.tar.bz2 xen-d91702d514466fec42323d9e5f1fc4161073b74f.zip |
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@jp.fujitsu.com>
-rw-r--r-- | tools/xenstat/libxenstat/src/xenstat.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/tools/xenstat/libxenstat/src/xenstat.c b/tools/xenstat/libxenstat/src/xenstat.c index 559fb9bec6..16a41dc1db 100644 --- a/tools/xenstat/libxenstat/src/xenstat.c +++ b/tools/xenstat/libxenstat/src/xenstat.c @@ -655,12 +655,20 @@ unsigned long long xenstat_vbd_wr_reqs(xenstat_vbd * vbd) static char *xenstat_get_domain_name(xenstat_handle *handle, unsigned int domain_id) { - char path[80]; + 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); - snprintf(path, sizeof(path),"/local/domain/%i/name", domain_id); - 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) |