e5de6370bc08b900201238b52ef065a46fdd14c8
[virt-df.git] / lib / README
1 For user documentation:
2
3 Please see the manual page (virt-df.pod or virt-df.txt in this
4 directory).
5
6 Developer documentation
7 ----------------------------------------------------------------------
8
9 This subdirectory contains a library of useful functions for parsing
10 disk images.
11
12 It is all based on and uses the pa_bitmatch syntax extension &
13 library.  You need pa_bitmatch >= 1.9.5.
14
15 This program has suddenly become rather large and confusing.
16 Hopefully this documentation should go some way towards explaining
17 what is going on inside the source.
18
19 The main program consists of two modules:
20
21  - diskimage.ml / diskimage.mli
22
23    This is the library.  It loads the domain descriptions, calls out
24    to the plug-ins to probe for disks / partitions / filesystems /
25    etc., and finally returns the results.
26
27  - diskimage_utils.ml / diskimage_utils.mli (module name: Diskimage_utils)
28
29    This has evolved into a library of miscellaneous functions
30    and values which are included throughout the rest of the
31    program.  If you see an unexplained function then it's
32    likely that it is defined in here.
33
34    Start by reading diskimage.mli which contains the full types
35    and plenty of documentation.
36
37 Everything else in this directory is a plug-in specialized for probing
38 a particular filesystem, partition scheme or type of LVM.  The
39 plug-ins at time of writing are:
40
41  - diskimage_ext2.ml / diskimage_ext2.mli
42
43    EXT2/3/4 plug-in.
44
45  - diskimage_linux_swap.ml / diskimage_linux_swap.mli
46
47    Linux swap (new style) plug-in.
48
49  - diskimage_mbr.ml / diskimage_mbr.mli
50
51    Master Boot Record (MS-DOS) disk partitioning plug-in.
52
53  - diskimage_lvm2*
54
55    LVM2 parsing, which is by far the most complex plug-in.
56    It consists of:
57
58    - diskimage_lvm2.ml
59    - diskimage_lvm2.mli
60      LVM2 probing, PV detection.
61
62    - diskimage_lvm2_parser.mly
63    - diskimage_lvm2_lexer.mll
64      Scanner/parser for parsing LVM2 metadata definitions.
65
66    - diskimage_lvm2_metadata.ml
67    - diskimage_lvm2_metadata.mli
68      AST for LVM2 metadata definitions.