Re: [PATCH 2/3] Debug: Remove unnecessary errors reported while parsing non-existent sysfs files.

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

 



On Wed, Mar 22, 2017 at 01:02:18 -0700, Prerna Saxena wrote:
> Sample from current logs:
> error : virFileReadAll:1290 : Failed to open file '/sys/class/net/tap3/operstate': No such file or directory
> error : virNetDevGetLinkInfo:1895 : unable to read: /sys/class/net/tap3/operstate: No such file or directory
> 
> These have no useful data point and are redundant.
> 
> Signed-off-by: Prerna Saxena <saxenap.ltc@xxxxxxxxx>
> ---
>  src/util/virnetdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
> index d123248..3e2f962 100644
> --- a/src/util/virnetdev.c
> +++ b/src/util/virnetdev.c
> @@ -1874,7 +1874,7 @@ virNetDevGetLinkInfo(const char *ifname,
>      if (virNetDevSysfsFile(&path, ifname, "operstate") < 0)
>          goto cleanup;
>  
> -    if (virFileReadAll(path, 1024, &buf) < 0) {
> +    if (virFileReadAllQuiet(path, 1024, &buf) < 0 && errno != ENOENT) {
>          virReportSystemError(errno,
>                               _("unable to read: %s"),
>                               path);

Remove this message here instead of switching to virFileReadAllQuiet.
virFileReadAll reports messages according to the failure itself.

Attachment: signature.asc
Description: PGP signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux