Skip to contentSkip to conversation

Fix domain names that xentop shows

PATCH New Masaki Kanno 1 participant 1 message May 26, 2008

lore
Share & tools
lore
#0 lore raw

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.

Best regards,
Kan

tools/xenstat/libxenstat/src/xenstat.c +13 -5
diff -r 28083093cc5d tools/xenstat/libxenstat/src/xenstat.c
@@ -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-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel