Re: [Xen-devel] [PATCH 1/1] tools/ocaml: Re-introduce Xenctrl.with_intf wrapper

2018-11-01 Thread Ian Jackson
Christian Lindig writes ("[PATCH 1/1] tools/ocaml: Re-introduce Xenctrl.with_intf wrapper"): > Commit 81946a73dc975a7dafe9017a8e61d1e64fdbedbf removed > Xenctrl.with_intf based on its undesirable behaviour of opening and > closing a Xenctrl connection with every invocation. This commit >

[Xen-devel] [PATCH 1/1] tools/ocaml: Re-introduce Xenctrl.with_intf wrapper

2018-11-01 Thread Christian Lindig
Commit 81946a73dc975a7dafe9017a8e61d1e64fdbedbf removed Xenctrl.with_intf based on its undesirable behaviour of opening and closing a Xenctrl connection with every invocation. This commit re-introduces with_intf but with an updated behaviour: it maintains a global Xenctrl connection which is

[Xen-devel] [PATCH 1/1] tools/ocaml: Re-introduce Xenctrl.with_intf wrapper

2018-10-31 Thread Christian Lindig
Commit 81946a73dc975a7dafe9017a8e61d1e64fdbedbf removed Xenctrl.with_intf based on its undesirable behaviour of opening and closing a Xenctrl connection with every invocation. This commit re-introduces with_intf but with an updated behaviour: it maintains a global Xenctrl connection which is

Re: [Xen-devel] [PATCH 1/1] tools/ocaml: Re-introduce Xenctrl.with_intf wrapper

2018-10-30 Thread Ian Jackson
Christian Lindig writes ("Re: [Xen-devel] [PATCH 1/1] tools/ocaml: Re-introduce Xenctrl.with_intf wrapper"): > I agree that it would not harm but conceptually I believe you > should manage this explicitly using interface_{open/close} or implicitly > using with_intf. I would

Re: [Xen-devel] [PATCH 1/1] tools/ocaml: Re-introduce Xenctrl.with_intf wrapper

2018-10-30 Thread Christian Lindig
> On 30 Oct 2018, at 17:01, Ian Jackson wrote: > > Well, yes, but who would ever call it ? It's not safe to use except > at the toplevel (whatever that means, but probably outside any > with_intf) because elsewhere you don't know whose work you're > sabotaging. > > Which reminds me: why do

Re: [Xen-devel] [PATCH 1/1] tools/ocaml: Re-introduce Xenctrl.with_intf wrapper

2018-10-30 Thread Ian Jackson
Christian Lindig writes ("Re: [Xen-devel] [PATCH 1/1] tools/ocaml: Re-introduce Xenctrl.with_intf wrapper"): > You are right - close_handle should set the handle to None in addition. > > > For that matter, why is close_handle needed at all ? > > I mostly added it f

Re: [Xen-devel] [PATCH 1/1] tools/ocaml: Re-introduce Xenctrl.with_intf wrapper

2018-10-30 Thread Christian Lindig
> On 30 Oct 2018, at 16:48, Ian Jackson wrote: > > I think it would be better to have close_handle set handle to None, > and write in the docs that it is forbidden to call close_handle within > with_intf. You are right - close_handle should set the handle to None in addition. > For that

Re: [Xen-devel] [PATCH 1/1] tools/ocaml: Re-introduce Xenctrl.with_intf wrapper

2018-10-30 Thread Ian Jackson
Christian Lindig writes ("[Xen-devel] [PATCH 1/1] tools/ocaml: Re-introduce Xenctrl.with_intf wrapper"): > Commit 81946a73dc975a7dafe9017a8e61d1e64fdbedbf removed > Xenctrl.with_intf based on its undesirable behaviour of opening and > closing a Xenctrl connection wi

[Xen-devel] [PATCH 1/1] tools/ocaml: Re-introduce Xenctrl.with_intf wrapper

2018-10-30 Thread Christian Lindig
Commit 81946a73dc975a7dafe9017a8e61d1e64fdbedbf removed Xenctrl.with_intf based on its undesirable behaviour of opening and closing a Xenctrl connection with every invocation. This commit re-introduces with_intf but with an updated behaviour: it maintains a global Xenctrl connection which is