[Libvir] OCaml binding 0.3.0.1 released

Richard W.M. Jones rjones at redhat.com
Fri Jul 13 19:34:17 UTC 2007


Richard W.M. Jones wrote:
> http://et.redhat.com/~rjones/ocaml-libvirt/

Just a quick note to say that I've upgraded the bindings again.

- Included the fix for domain/network handles in mlvirsh 
(http://www.redhat.com/archives/libvir-list/2007-June/msg00361.html)

- Connections, domain and network handles are now statically typed 
"read-write" or "read-only".  C.connect gives you a read-write 
connection handle.  C.connect_readonly gives you a read-only connection 
handle.  From a read-only connection handle you can only derive 
read-only domain and network handles.  You can demote a read-write 
handle to a read-only handle using the C/D/N.const functions, but 
obviously not the other way around.  This makes it impossible to compile 
programs that do write/update things on read-only handles.  No code 
changes are required[1] and there is no runtime penalty.

As a good example of this, see 
http://et.redhat.com/~rjones/ocaml-libvirt/html/Libvirt.Domain.html#VALcreate_linux 

and the subsequent functions.

Rich.

[1] Well, unless you were doing unsafe things with read-only handles 
before, in which case you need to fix your program!

-- 
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom.  Registered in
England and Wales under Company Registration No. 03798903
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3237 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20070713/21bc1673/attachment-0001.bin>


More information about the libvir-list mailing list