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
|