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

[Xen-devel] [PATCH 2/2] xenstat: Use local domain names



The domain name stored in /local/domain/$domid/name is simpler to
access and is the only domain name modified by "xl rename". Use this
domain name in libxenstat's reporting.

Signed-off-by: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
---
 tools/xenstat/libxenstat/src/xenstat.c |   12 ++----------
 1 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/tools/xenstat/libxenstat/src/xenstat.c 
b/tools/xenstat/libxenstat/src/xenstat.c
index 2791cc1..104655d 100644
--- a/tools/xenstat/libxenstat/src/xenstat.c
+++ b/tools/xenstat/libxenstat/src/xenstat.c
@@ -739,17 +739,9 @@ unsigned long long 
xenstat_tmem_succ_pers_gets(xenstat_tmem *tmem)
 
 static char *xenstat_get_domain_name(xenstat_handle *handle, unsigned int 
domain_id)
 {
-       char path[80], *vmpath;
+       char path[80];
 
-       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);
 }
-- 
1.7.6.4


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


 


Rackspace

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