Skip to content

Commit a4b992c

Browse files
committed
networkd: Add ENOENT to the list of expected errors in Sysfs.read_one_line
Otherwise this quite frequently logs something like: ``` xcp-networkd: [error||22 |dbsync (update_env)|network_utils] Error in read one line of file: /sys/class/net/eth0/device/sriov_totalvfs, exception Unix.Unix_error(Unix.ENOENT, "open", "/sys/class/net/eth0/device/sriov_totalvfs") Backtrace ... ``` Signed-off-by: Andrii Sultanov <[email protected]>
1 parent 929eefd commit a4b992c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ocaml/networkd/lib/network_utils.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ module Sysfs = struct
162162
with
163163
| End_of_file ->
164164
""
165-
| Unix.Unix_error (Unix.EINVAL, _, _) ->
165+
| Unix.Unix_error (Unix.EINVAL, _, _) | Unix.Unix_error (Unix.ENOENT, _, _)
166+
->
166167
(* The device is not yet up *)
167168
raise (Network_error (Read_error file))
168169
| exn ->

0 commit comments

Comments
 (0)