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

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

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

On Thu, Sep 09, 2010 at 10:48:44AM -0400, Cole Robinson wrote:
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
[...]
ACK if a brief comment is added explaining the situation.
- Cole
ACK looks fine to me too, I pushed with a comment, Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/
participants (3)
-
Cole Robinson
-
Daniel Veillard
-
Guido Günther