[libvirt] ocaml: prototype bindings for event callbacks

David Scott scott.dj at gmail.com
Wed Mar 27 16:59:29 UTC 2013


Hi,

I've made an prototype set of ocaml bindings for the libvirt event
mechanism -- here is what I've got so far.

It's possible to register for all the types supported by

  virConnectDomainEventRegisterAny

I've not tested each type of event yet, but the basics are all working.

For every distinct callback function signature it maintains:

  1. OCaml: a hashtable mapping callback_id (int64) to a specific closure
  2. OCaml: a function registered with Callback.register
  3. C: a function registered with libvirt, which upcalls to OCaml

There's still some missing polish, for example I've not implemented a
means to actually deregister a callback :-) I thought it would be best
to get feedback on the overall approach, style of the mapping etc first.

Comments and criticism greatly appreciated!

Thanks,
Dave




More information about the libvir-list mailing list