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

Re: [libvirt] [PATCH] fix path to xen device statistics for newer kernels



On 09/08/2010 03:35 PM, Guido Günther wrote:
> Hi,
> it seems Xen changed the paths to the block device statistics in sysfs:
> from "/sys/devices/xen-backend/vbd-%d-%d/statistics/%s" to
> "/sys/bus/xen-backend/devices/vbd-%d-%d/statistics/%s":
> 
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=596004
> 
> Attached patch fixes this. O.k. to apply?
>  -- Guido
> 

> diff --git a/src/xen/block_stats.c b/src/xen/block_stats.c
> index 6e7a5c3..1d875f2 100644
> --- a/src/xen/block_stats.c
> +++ b/src/xen/block_stats.c
> @@ -118,6 +118,18 @@ read_bd_stat (int device, int domid, const char *str)
>      int64_t r;
>  
>      snprintf (path, sizeof path,
> +              "/sys/bus/xen-backend/devices/vbd-%d-%d/statistics/%s",
> +              domid, device, str);
> +    r = read_stat (path);
> +    if (r >= 0) return r;
> +
> +    snprintf (path, sizeof path,
> +              "/sys/bus/xen-backend/devices/tap-%d-%d/statistics/%s",
> +              domid, device, str);
> +    r = read_stat (path);
> +    if (r >= 0) return r;
> +
> +    snprintf (path, sizeof path,
>                "/sys/devices/xen-backend/vbd-%d-%d/statistics/%s",
>                domid, device, str);
>      r = read_stat (path);

ACK if a brief comment is added explaining the situation.

- Cole


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