* [PATCH] ocaml/xs: prefer using character device
@ 2015-09-01 18:34 Doug Goldstein
2015-09-01 18:53 ` Wei Liu
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Doug Goldstein @ 2015-09-01 18:34 UTC (permalink / raw)
To: xen-devel; +Cc: Doug Goldstein
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@cardoe.com>
---
tools/ocaml/libs/xs/xs.ml | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
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
--
2.1.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] ocaml/xs: prefer using character device
2015-09-01 18:34 [PATCH] ocaml/xs: prefer using character device Doug Goldstein
@ 2015-09-01 18:53 ` Wei Liu
2015-09-02 9:50 ` Dave Scott
2015-09-02 10:15 ` Wei Liu
2 siblings, 0 replies; 5+ messages in thread
From: Wei Liu @ 2015-09-01 18:53 UTC (permalink / raw)
To: Doug Goldstein; +Cc: Dave Scott, wei.liu2, xen-devel
Cc Dave
On Tue, Sep 01, 2015 at 01:34:02PM -0500, Doug Goldstein wrote:
> 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@cardoe.com>
> ---
> tools/ocaml/libs/xs/xs.ml | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> 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
> --
> 2.1.4
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ocaml/xs: prefer using character device
2015-09-01 18:34 [PATCH] ocaml/xs: prefer using character device Doug Goldstein
2015-09-01 18:53 ` Wei Liu
@ 2015-09-02 9:50 ` Dave Scott
2015-09-02 11:21 ` Ian Campbell
2015-09-02 10:15 ` Wei Liu
2 siblings, 1 reply; 5+ messages in thread
From: Dave Scott @ 2015-09-02 9:50 UTC (permalink / raw)
To: Doug Goldstein; +Cc: xen-devel@lists.xen.org
Looks fine to me.
Acked-by: David Scott <dave.scott@citrix.com>
> On 1 Sep 2015, at 19:34, Doug Goldstein <cardoe@cardoe.com> wrote:
>
> 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@cardoe.com>
> ---
> tools/ocaml/libs/xs/xs.ml | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> 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
> --
> 2.1.4
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ocaml/xs: prefer using character device
2015-09-01 18:34 [PATCH] ocaml/xs: prefer using character device Doug Goldstein
2015-09-01 18:53 ` Wei Liu
2015-09-02 9:50 ` Dave Scott
@ 2015-09-02 10:15 ` Wei Liu
2 siblings, 0 replies; 5+ messages in thread
From: Wei Liu @ 2015-09-02 10:15 UTC (permalink / raw)
To: Doug Goldstein; +Cc: wei.liu2, xen-devel
On Tue, Sep 01, 2015 at 01:34:02PM -0500, Doug Goldstein wrote:
> 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@cardoe.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
> ---
> tools/ocaml/libs/xs/xs.ml | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> 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
> --
> 2.1.4
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ocaml/xs: prefer using character device
2015-09-02 9:50 ` Dave Scott
@ 2015-09-02 11:21 ` Ian Campbell
0 siblings, 0 replies; 5+ messages in thread
From: Ian Campbell @ 2015-09-02 11:21 UTC (permalink / raw)
To: Dave Scott, Doug Goldstein; +Cc: xen-devel@lists.xen.org
On Wed, 2015-09-02 at 09:50 +0000, Dave Scott wrote:
> Looks fine to me.
>
> Acked-by: David Scott <dave.scott@citrix.com>
Applied.
>
> > On 1 Sep 2015, at 19:34, Doug Goldstein <cardoe@cardoe.com> wrote:
> >
> > 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@cardoe.com>
> > ---
> > tools/ocaml/libs/xs/xs.ml | 8 +++++++-
> > 1 file changed, 7 insertions(+), 1 deletion(-)
> >
> > 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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-09-02 11:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-01 18:34 [PATCH] ocaml/xs: prefer using character device Doug Goldstein
2015-09-01 18:53 ` Wei Liu
2015-09-02 9:50 ` Dave Scott
2015-09-02 11:21 ` Ian Campbell
2015-09-02 10:15 ` Wei Liu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.