Outline Rust bindings
Outline Rust bindings, obviously incomplete. Attached is an example program showing how these bindings might be used. The most obvious thing is all the explicit error checking that the caller must do (same as in C). I'm not sure how natural that is, but the alternatives seem to be lots of calls to either 'assert!' or 'panic!' functions. To try it out: (1) Apply the patch. (2) Copy attached main.rc into rust/src/ (3) Build libguestfs. (4) Do: cd rust cargo build cargo run Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top
Updated patch. This one doesn't compile, with some kind of obscure Rust error that I can't be bothered with right now. Instructions in the previous message. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
participants (1)
-
Richard W.M. Jones