[libvirt] ocaml: prototype bindings for event callbacks

Richard W.M. Jones rjones at redhat.com
Wed Mar 27 17:38:31 UTC 2013


On Wed, Mar 27, 2013 at 04:59:29PM +0000, David Scott wrote:
> 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!

I looked over this, and it all looks pretty sensible to me.  Let
me know when you're ready to have a patch applied upstream.

The one comment I would make (which is not related directly to your
patch, but would make it simpler) is that we ought to change the
minimum supported version of libvirt from whatever it is now (0.2.1?)
to some much more recent version.  I don't think anyone would care if
ocaml-libvirt only worked with, say, libvirt >= 0.9.1 which was
released in May 2011.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW




More information about the libvir-list mailing list