diff --git a/tools/ocaml/libs/xs/xs.ml b/tools/ocaml/libs/xs/xs.ml index 5757571072..7e14487939 100644 --- a/tools/ocaml/libs/xs/xs.ml +++ b/tools/ocaml/libs/xs/xs.ml @@ -162,7 +162,13 @@ let daemon_open () = with _ -> raise Failed_to_connect let domain_open () = - let path = "/proc/xen/xenbus" in + let path = try + let devpath = "/dev/xen/xenbus" in + Unix.access devpath [ Unix.F_OK ]; + devpath + with Unix.Unix_error(_, _, _) -> + "/proc/xen/xenbus" in + let fd = Unix.openfile path [ Unix.O_RDWR ] 0o550 in Unix.set_close_on_exec fd; make fd