提交 8a70113a 编写于 作者: G Guido Günther 提交者: Daniel Veillard

Fix block statistics with newer versions of Xen

Apparently the xen block device statistics moved from
"/sys/devices/xen-backend/vbd-%d-%d/statistics/%s"
to
"/sys/bus/xen-backend/devices/vbd-%d-%d/statistics/%s"

* src/xen/block_stats.c: try the extra path in case of failure to
  find the statistics in /sys
上级 dfec22cc
...@@ -117,6 +117,18 @@ read_bd_stat (int device, int domid, const char *str) ...@@ -117,6 +117,18 @@ read_bd_stat (int device, int domid, const char *str)
char path[PATH_MAX]; char path[PATH_MAX];
int64_t r; 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, snprintf (path, sizeof path,
"/sys/devices/xen-backend/vbd-%d-%d/statistics/%s", "/sys/devices/xen-backend/vbd-%d-%d/statistics/%s",
domid, device, str); domid, device, str);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册