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

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

To: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 2/2] xenstat: Use local domain names
From: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Date: Thu, 10 Nov 2011 19:51:53 +0000
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Delivery-date: Thu, 10 Nov 2011 11:52:40 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1320862287-11787-2-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>
Organization: Citrix Systems, Inc.
References: <1320862287-11787-1-git-send-email-dgdegra@xxxxxxxxxxxxx> <1320862287-11787-2-git-send-email-dgdegra@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Wed, 2011-11-09 at 18:11 +0000, Daniel De Graaf wrote:
> 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.

As it happens I noticed this today too since it causes dom0 not to show
up in xentop. My workaround was to add to my initscripts:

xenstore-write /vm/00000000-0000-0000-0000-000000000000/name "Domain-0"
xenstore-write /local/domain/0/vm /vm/00000000-0000-0000-0000-000000000000

I wondered what xend does and it seems that it also creates
both /local/domain/N/name and /vm/UUID/name but only updates the latter
on "xm rename". So it seems that xend and xl behave exactly opposite wrt
which one they change on rename. Leaving aside that it seems buggy to a)
record the name twice and b) only update one copy on rename I think "xl
rename" should either do the same thing as "xm rename" or it should
update both names in xenstore (or maybe we should drop one).

Ian.

> 
> 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);
>  }



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

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