Fix domain names that xentop shows
PATCH 1/1 Fix domain names that xentop shows
Hi,
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 <[email protected]>
Best regards,
Kan
tools/xenstat/libxenstat/src/xenstat.c +13 -5
@@ -655,12 +655,20 @@ unsigned long long xenstat_vbd_wr_reqs(xstatic 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-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel