]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
tools/ocaml: Delete the Xenctrl.with_intf wrapper
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 3 Oct 2018 13:11:20 +0000 (14:11 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 4 Oct 2018 13:54:36 +0000 (14:54 +0100)
This wrapper hides an opening and closing of the xenctrl handle, which amongst
other things opens and closes multiple device files.

A process should create one handle at the start of day and reuse that; indeed
there is no guarentee that the process will retain sufficient permissions to
re-open /dev/xen/privcmd at a later point.

With the final user of Xenctrl.with_intf removed, drop the wrapper entirely.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Christian Lindig <christian.lindig@citrix.com>
tools/ocaml/libs/xc/xenctrl.ml
tools/ocaml/libs/xc/xenctrl.mli

index 40fbd3790ff042e6bbb702c0d0ef92fa755fb069..955dd92546db040f11041fafafe86e2b00381876 100644 (file)
@@ -141,12 +141,6 @@ type handle
 external interface_open: unit -> handle = "stub_xc_interface_open"
 external interface_close: handle -> unit = "stub_xc_interface_close"
 
-let with_intf f =
-       let xc = interface_open () in
-       let r = try f xc with exn -> interface_close xc; raise exn in
-       interface_close xc;
-       r
-
 external domain_create: handle -> domctl_create_config -> domid
        = "stub_xc_domain_create"
 
index 906ce9486b769aef057561d9f4b24bea5d3c6732..eeed24fa966a3b707093126f361ed4bd4ae2786e 100644 (file)
@@ -108,7 +108,7 @@ exception Error of string
 type handle
 external interface_open : unit -> handle = "stub_xc_interface_open"
 external interface_close : handle -> unit = "stub_xc_interface_close"
-val with_intf : (handle -> 'a) -> 'a
+
 external domain_create : handle -> domctl_create_config -> domid
   = "stub_xc_domain_create"
 external domain_sethandle : handle -> domid -> string -> unit = "stub_xc_domain_sethandle"