[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] ocaml/xs: prefer using character device
commit 7d418eab3b6dbdeec84bf73af301dca54368547a Author: Doug Goldstein <cardoe@xxxxxxxxxx> AuthorDate: Tue Sep 1 13:34:02 2015 -0500 Commit: Ian Campbell <ian.campbell@xxxxxxxxxx> CommitDate: Wed Sep 2 12:05:41 2015 +0100 ocaml/xs: prefer using character device Since 9c89dc95201ffed5fead17b35754bf9440fdbdc0 libxenstore prefers using /dev/xen/xenbus over /proc/xen/xenbus. This makes the OCaml xenstore library contain the same preference. Signed-off-by: Doug Goldstein <cardoe@xxxxxxxxxx> Acked-by: David Scott <dave.scott@xxxxxxxxxx> --- tools/ocaml/libs/xs/xs.ml | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/tools/ocaml/libs/xs/xs.ml b/tools/ocaml/libs/xs/xs.ml index 5757571..7e14487 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 -- generated by git-patchbot for /home/xen/git/xen.git#master _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |