D.get_id returns -1 for inactive domains instead of throwing an error.
[ocaml-libvirt.git] / README
1 ocaml-libvirt
2 ----------------------------------------------------------------------
3
4 Copyright (C) 2007-2008 Richard W.M. Jones, Red Hat Inc.
5 http://libvirt.org/ocaml/
6 http://libvirt.org/
7
8 This is a complete set of OCaml bindings around libvirt, exposing all
9 known functionality to OCaml programs.
10
11 Building
12 ----------------------------------------------------------------------
13
14   ./configure           # Checks that you have all the required bits.
15
16   make all              # Builds the bytecode version of libs/programs.
17   make opt              # Builds the native code version of libs/programs.
18
19   make install          # Install in OCaml directory, and the binaries
20                         # in $prefix/bin.
21
22   make doc              # Build HTML documentation in html/ subdirectory.
23
24 Then have a look at the program 'mlvirsh.opt'.
25
26 Note: If you want to run the programs without first installing, you
27 may need to set your $LD_LIBRARY_PATH environment variable so it
28 contains the build directory.  eg:
29
30   LD_LIBRARY_PATH=libvirt/ mlvirsh/mlvirsh.opt
31
32
33 Windows
34 ----------------------------------------------------------------------
35
36 I have built libvirt (the bindings), examples, mlvirsh and virt-ctrl
37 on Windows using the MinGW port of OCaml.  It's quite likely that it
38 will also work under VC++, but I have not tested this.
39
40 You should make sure that your $PATH (environment variable) contains
41 the names of the directories containing all required DLLs, in
42 particular you will require:
43
44   libvirt-*.dll         (from libvirt)
45   libgnutls-*.dll       (from GnuTLS)
46   libgcrypt-*.dll
47   libgpg-error-*.dll
48   libtasn1-*.dll
49   libxdr.dll            (from libxdr)
50   libxml2-*.dll         (from libxml2)
51   and, a multitude of DLLs from GTK if you want to run virt-ctrl
52
53 You can use a tool such as Dependency Walker to find/check the
54 locations of dependent libraries.
55
56 To build the Windows installer, you will need NSIS.  Then do:
57
58   ./configure --with-nsis=/c/Progra~1/NSIS
59   make all opt
60   make wininstaller
61
62 This should build a Windows binary installer called
63 ocaml-libvirt-$VERSION.exe which includes the bindings, all required
64 DLLs and all programs that can be built under Windows.
65
66
67 mlvirsh
68 ----------------------------------------------------------------------
69
70 'mlvirsh' is an almost complete reimplementation of virsh, which is
71 mostly command compatible (there are a very few commands missing, and
72 some commands have a slightly different syntax, but broadly speaking
73 they are equivalent programs except that one is written in C and the
74 other in OCaml).
75
76 At the time of writing:
77
78               wc -c  wc -l
79
80   virsh     126,056  4,641
81   mlvirsh    19,427    598
82
83   % size        15%    13%
84
85
86 Programming
87 ----------------------------------------------------------------------
88
89 For documentation on these bindings, read libvirt.mli and/or 'make
90 doc' and browse the HTML documentation in the html/ subdirectory.
91
92 For documentation on libvirt itself, see http://libvirt.org/html/
93
94
95 License
96 ----------------------------------------------------------------------
97
98 The library is distributed under the GNU LGPL, version 2 or above,
99 with the OCaml linking exception.  Please see COPYING.LIB for details.
100
101 The standalone program 'mlvirsh' is distributed under the GNU GPL,
102 version 2 or above.  Please see COPYING for details.
103
104 Examples are public domain.
105
106
107 Subdirectories
108 ----------------------------------------------------------------------
109
110 libvirt/                The OCaml bindings.
111 examples/               Some example programs using the bindings.
112 mlvirsh/                'mlvirsh' command line tool.