diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2011-01-06 17:37:00 +0000 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2011-01-06 17:37:00 +0000 |
commit | 30cbc3ec4b4ecfd293f689c0f19126ecc5549c0d (patch) | |
tree | e7c3b28d66fe33e42b353f4d2b55bafb26b23752 /tools/ocaml/xenstored/event.ml | |
parent | daec2beeaf53611dd145c4196eaee5cdd2e55a81 (diff) | |
download | xen-30cbc3ec4b4ecfd293f689c0f19126ecc5549c0d.tar.gz xen-30cbc3ec4b4ecfd293f689c0f19126ecc5549c0d.tar.bz2 xen-30cbc3ec4b4ecfd293f689c0f19126ecc5549c0d.zip |
ocaml: evtchn+xc bindings: use libxenctrl and libxenguest
Now that tools/libxc is licensed under LGPL I don't think there is any need for
an LGPL reimplementation under tools/ocaml.
For the most part the conversion to the up-to-date libxc API (xc_lib.c
essentially implemented the same interface as an older libxc) was pretty
automatic. There are some functions which appear to no longer exist in libxc
which I therefore simply removed the bindings for and a small number of
interfaces which had changed.
Many of the functions bound by the stubs have no in-tree users (which I think
is fine for a language binding) so I have no way to confirm correctness other
than by eye. I was however able to confirm that oxenstored still worked and to
build a XCP toolstack which could successfully start a PV guest.
Uses the new XC_OPENFLAG_NON_REENTRANT option to avoid potential conflicts
between pthreads and the ocaml runtime.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Vincent Hanquez <Vincent.Hanquez@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/ocaml/xenstored/event.ml')
-rw-r--r-- | tools/ocaml/xenstored/event.ml | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/tools/ocaml/xenstored/event.ml b/tools/ocaml/xenstored/event.ml index 0e6ed03fe8..b2df7a495d 100644 --- a/tools/ocaml/xenstored/event.ml +++ b/tools/ocaml/xenstored/event.ml @@ -16,14 +16,15 @@ (**************** high level binding ****************) type t = { - fd: Unix.file_descr; + handle: Eventchn.handle; mutable virq_port: int; } -let init () = { fd = Eventchn.init (); virq_port = -1; } -let bind_dom_exc_virq eventchn = eventchn.virq_port <- Eventchn.bind_dom_exc_virq eventchn.fd -let bind_interdomain eventchn domid port = Eventchn.bind_interdomain eventchn.fd domid port -let unbind eventchn port = Eventchn.unbind eventchn.fd port -let notify eventchn port = Eventchn.notify eventchn.fd port -let read_port eventchn = Eventchn.read_port eventchn.fd -let write_port eventchn port = Eventchn.write_port eventchn.fd port +let init () = { handle = Eventchn.init (); virq_port = -1; } +let fd eventchn = Eventchn.fd eventchn.handle +let bind_dom_exc_virq eventchn = eventchn.virq_port <- Eventchn.bind_dom_exc_virq eventchn.handle +let bind_interdomain eventchn domid port = Eventchn.bind_interdomain eventchn.handle domid port +let unbind eventchn port = Eventchn.unbind eventchn.handle port +let notify eventchn port = Eventchn.notify eventchn.handle port +let pending eventchn = Eventchn.pending eventchn.handle +let unmask eventchn port = Eventchn.unmask eventchn.handle port |