ocaml/xs: prefer using character device
PATCH 1/1 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.
--- tools/ocaml/libs/xs/xs.ml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
tools/ocaml/libs/xs/xs.ml +7 -1
@@ -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
Signature · 1 line
2.1.4
Cc Dave
Quoted 36 lines · Doug Goldstein
Since
9c89dc95201ffed5fead17b35754bf9440fdbdc0libxenstore prefers using/dev/xen/xenbusover/proc/xen/xenbus. This makes the OCaml xenstore library contain the same preference.Signed-off-by Doug Goldstein <[email protected]>--- tools/ocaml/libs/xs/xs.ml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)tools/ocaml/libs/xs/xs.ml +7
-1@@ -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 fdSignature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
Looks fine to me.
Quoted 38 lines · Doug Goldstein
Since
9c89dc95201ffed5fead17b35754bf9440fdbdc0libxenstore prefers using/dev/xen/xenbusover/proc/xen/xenbus. This makes the OCaml xenstore library contain the same preference.Signed-off-by Doug Goldstein <[email protected]>---
tools/ocaml/libs/xs/xs.ml| 8 +++++++-1 file changed, 7 insertions(+), 1 deletion(-)tools/ocaml/libs/xs/xs.ml +0
-0@@ -162,7 +162,13 @@ let daemon_open () = with _ -> raise Failed_to_connectlet
domain_open() =tools/ocaml/libs/xs/xs.ml +7
-1- 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 fdSignature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
Ian Campbell
AppliedQuoted 3 lines · Dave Scott
Looks fine to me.
Acked-by David Scott <[email protected]>
Applied.
Quoted 32 lines
Quoted 32 lines · Doug Goldstein
Since
9c89dc95201ffed5fead17b35754bf9440fdbdc0libxenstore prefers using/dev/xen/xenbusover/proc/xen/xenbus. This makes the OCaml xenstore library contain the same preference.Signed-off-by Doug Goldstein <[email protected]>---
tools/ocaml/libs/xs/xs.ml| 8 +++++++-1 file changed, 7 insertions(+), 1 deletion(-)tools/ocaml/libs/xs/xs.ml +0
-0@@ -162,7 +162,13 @@ let daemon_open () = with _ -> raise Failed_to_connectlet
domain_open() =tools/ocaml/libs/xs/xs.ml +7
-1- 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
Quoted 5 lines · Doug Goldstein
Since
9c89dc95201ffed5fead17b35754bf9440fdbdc0libxenstore prefers using/dev/xen/xenbusover/proc/xen/xenbus. This makes the OCaml xenstore library contain the same preference.Signed-off-by Doug Goldstein <[email protected]>
Quoted 31 lines
--- tools/ocaml/libs/xs/xs.ml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)tools/ocaml/libs/xs/xs.ml +7
-1@@ -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 fdSignature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel