WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: ian.jackson@xxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 2/2] xenstat: Use local domain names
From: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
Date: Wed, 9 Nov 2011 13:11:27 -0500
Cc: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 09 Nov 2011 10:21:58 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1320862287-11787-1-git-send-email-dgdegra@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1320862287-11787-1-git-send-email-dgdegra@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>