Re: [Xen-devel] [PATCH] tools/oxenstored: port XS_INTRODUCE evtchn rebind function from cxenstored

2019-08-20 Thread Christian Lindig
> On 20 Aug 2019, at 13:45, Igor Druzhinin wrote: > > con is passed into that function from xenstored.ml where it's extracted > from the same hashtable (Connections) so it's actually the exactly same > object. This comes down to what semantics you want. It is unfortunate that Connection.t

Re: [Xen-devel] [PATCH] tools/oxenstored: port XS_INTRODUCE evtchn rebind function from cxenstored

2019-08-20 Thread Igor Druzhinin
On 20/08/2019 13:11, Christian Lindig wrote: > > >> On 20 Aug 2019, at 11:45, Igor Druzhinin wrote: >> >> On 20/08/2019 09:21, Christian Lindig wrote: + if (Domain.get_mfn edom) = mfn && (Connections.find_domain cons domid) != con then begin >>> >>> This should use

Re: [Xen-devel] [PATCH] tools/oxenstored: port XS_INTRODUCE evtchn rebind function from cxenstored

2019-08-20 Thread Christian Lindig
> On 20 Aug 2019, at 11:45, Igor Druzhinin wrote: > > On 20/08/2019 09:21, Christian Lindig wrote: >>> + if (Domain.get_mfn edom) = mfn && >>> (Connections.find_domain cons domid) != con then begin >> >> This should use <> instead of != because != is pointer inequality in

Re: [Xen-devel] [PATCH] tools/oxenstored: port XS_INTRODUCE evtchn rebind function from cxenstored

2019-08-20 Thread Igor Druzhinin
On 20/08/2019 09:21, Christian Lindig wrote: >> +if (Domain.get_mfn edom) = mfn && >> (Connections.find_domain cons domid) != con then begin > > This should use <> instead of != because != is pointer inequality in OCaml. > The parentheses are not strictly necessary because

Re: [Xen-devel] [PATCH] tools/oxenstored: port XS_INTRODUCE evtchn rebind function from cxenstored

2019-08-20 Thread Christian Lindig
> + if (Domain.get_mfn edom) = mfn && > (Connections.find_domain cons domid) != con then begin This should use <> instead of != because != is pointer inequality in OCaml. The parentheses are not strictly necessary because function application has precedence. So: if

[Xen-devel] [PATCH] tools/oxenstored: port XS_INTRODUCE evtchn rebind function from cxenstored

2019-08-19 Thread Igor Druzhinin
C version of xenstored had this ability since 61aaed0d5 ("Allow XS_INTRODUCE to be used for rebinding the xenstore evtchn.") from 2007. Copy it as is to Ocaml version. Signed-off-by: Igor Druzhinin --- tools/ocaml/xenstored/domain.ml | 6 +- tools/ocaml/xenstored/process.ml | 8 +++- 2