mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 01:45:17 +00:00
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
This commit is contained in:
parent
dfec22cc60
commit
8a70113a99
@ -117,6 +117,18 @@ read_bd_stat (int device, int domid, const char *str)
|
||||
char path[PATH_MAX];
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user