mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
Report one error less when getting net dev speed
virFileReadAll already logs an error. If reading the 'speed' file fails with EINVAL, we log an error even though we ignore it. If it fails with other errors, we log two errors. Use virFileReadAllQuiet - ignore EINVAL and report just one error in other cases. Fixes this error on libvirtd startup: 2014-06-30 12:47:14.583+0000: 20971: error : virFileReadAll:1297 : Failed to read file '/sys/class/net/wlan0/speed': Invalid argument
This commit is contained in:
parent
f638c13ea4
commit
1c7601f5c3
@ -1891,7 +1891,7 @@ virNetDevGetLinkInfo(const char *ifname,
|
||||
if (virNetDevSysfsFile(&path, ifname, "speed") < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (virFileReadAll(path, 1024, &buf) < 0) {
|
||||
if (virFileReadAllQuiet(path, 1024, &buf) < 0) {
|
||||
/* Some devices doesn't report speed, in which case we get EINVAL */
|
||||
if (errno == EINVAL) {
|
||||
ret = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user