From: Keir Fraser Date: Mon, 26 May 2008 07:37:43 +0000 (+0100) Subject: Fix domain names that xentop shows X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14207^2~32 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d91702d514466fec42323d9e5f1fc4161073b74f;p=xen.git 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 --- 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)