Skip to content

Commit

Permalink
Merge pull request #4861 from edwintorok/private/edvint/intf
Browse files Browse the repository at this point in the history
Xenctrl: drop interface_close
  • Loading branch information
edwintorok committed Dec 6, 2022
2 parents 3867203 + ac7602a commit c697869
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
6 changes: 2 additions & 4 deletions ocaml/xenopsd/dbgring/dbgring.ml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ let open_ring0 () =
Unix.close fd ; intf

let open_ringU domid mfn =
let xc = Xenctrl.interface_open () in
Xapi_stdext_pervasives.Pervasiveext.finally
(fun () -> Xenctrl.map_foreign_range xc domid (Xenmmap.getpagesize ()) mfn)
(fun () -> Xenctrl.interface_close xc)
Xenctrl.with_intf @@ fun xc ->
Xenctrl.map_foreign_range xc domid (Xenmmap.getpagesize ()) mfn

let open_ring domid mfn =
if domid = 0 then
Expand Down
5 changes: 1 addition & 4 deletions ocaml/xenopsd/xc/xenops_server_xen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5196,10 +5196,7 @@ let look_for_xen () =
exit 1

let look_for_xenctrl () =
try
let xc = Xenctrl.interface_open () in
debug "xenctrl interface is available" ;
Xenctrl.interface_close xc
try Xenctrl.with_intf @@ fun _xc -> debug "xenctrl interface is available"
with e ->
error "I failed to open the low-level xen control interface (xenctrl)" ;
error "The raw error was: %s" (Printexc.to_string e) ;
Expand Down

0 comments on commit c697869

Please sign in to comment.