mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
ocaml/xs: prefer using character device
Since 9c89dc9520 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@cardoe.com>
Acked-by: David Scott <dave.scott@citrix.com>
This commit is contained in:
1 parent
f843657642
commit
7d418eab3b
1 file changed
+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
|
||||
|
||||