- make all # Builds the bytecode version of libs/programs.
- make opt # Builds the native code version of libs/programs.
-
- make install # Install in OCaml directory, and the binaries
- # in $prefix/bin.
-
- make doc # Build HTML documentation in html/ subdirectory.
-
-Then have a look at the programs 'mlvirsh.opt' and 'mlvirtmanager.opt'.
-
-Note: If you want to run the programs without first installing, you
-may need to set your $LD_LIBRARY_PATH environment variable so it
-contains the build directory. eg:
-
- LD_LIBRARY_PATH=libvirt/ mlvirsh/mlvirsh.opt
-
-
-mlvirsh
-----------------------------------------------------------------------
-
-'mlvirsh' is an almost complete reimplementation of virsh, which is
-mostly command compatible (there are a very few commands missing, and
-some commands have a slightly different syntax, but broadly speaking
-they are equivalent programs except that one is written in C and the
-other in OCaml).
-
-At the time of writing:
-
- wc -c wc -l
-
- virsh 126,056 4,641
- mlvirsh 19,427 598
-
- % size 15% 13%
-
-
-mlvirtmanager
-----------------------------------------------------------------------
-
-'mlvirtmanager' is a demonstration implementation of virt-manager in
-OCaml. It is not feature-complete by any means, but does allow you to
-show the running domains and start and stop defined domains. The main
-functionality _missing_ is the ability to define new virtual machines,
-change the resources allocated to domains, or show the machine
-console.
-
-
-Programming
-----------------------------------------------------------------------
-
-The interface is described in 'libvirt.mli'. The main modules are
-Libvirt.Connect, Libvirt.Domain and Libvirt.Network, corresponding
-respectively to the virConnect*, virDomain*, and virNetwork*
-functions. For brevity I usually rename these modules like this:
-
- module C = Libvirt.Connect
- module D = Libvirt.Domain
- module N = Libvirt.Network
-
-To get a connection handle, do:
-
- let name = "xen:///"
- let conn = C.connect ~name ()
-
-To list domains, do:
-
- let n = C.num_of_domains conn
- let ids = C.list_domains conn n
- let domains = Array.map (D.lookup_by_id conn) ids
- let () =
- Array.iter (
- fun dom ->
- printf "%5d %s\n" (D.get_id dom) (D.get_name dom)
- ) domains
-
-(See also the program list_domains.ml).
-
-For documentation on these bindings, read libvirt.mli and/or 'make
-doc' and browse the HTML documentation in the html/ subdirectory.
-
-For documentation on libvirt itself, see http://libvirt.org/html/
-
-
-Subdirectories
-----------------------------------------------------------------------