For user documentation:

Please see the manual page (virt-df.pod or virt-df.txt in this
directory).

Developer documentation
----------------------------------------------------------------------

This subdirectory contains a library of useful functions for parsing
disk images.

It is all based on and uses the pa_bitstring syntax extension &
library.  You need pa_bitstring >= 1.9.7.

This program has suddenly become rather large and confusing.
Hopefully this documentation should go some way towards explaining
what is going on inside the source.

The main program consists of two modules:

 - diskimage.ml / diskimage.mli

   This is the library.  It loads the domain descriptions, calls out
   to the plug-ins to probe for disks / partitions / filesystems /
   etc., and finally returns the results.

 - diskimage_utils.ml / diskimage_utils.mli (module name: Diskimage_utils)

   This has evolved into a library of miscellaneous functions
   and values which are included throughout the rest of the
   program.  If you see an unexplained function then it's
   likely that it is defined in here.

   Start by reading diskimage.mli which contains the full types
   and plenty of documentation.

Everything else in this directory is a plug-in specialized for probing
a particular filesystem, partition scheme or type of LVM.  The
plug-ins at time of writing are:

 - diskimage_ext2.ml / diskimage_ext2.mli

   EXT2/3/4 plug-in.

 - diskimage_linux_swap.ml / diskimage_linux_swap.mli

   Linux swap (new style) plug-in.

 - diskimage_mbr.ml / diskimage_mbr.mli

   Master Boot Record (MS-DOS) disk partitioning plug-in.

 - diskimage_lvm2*

   LVM2 parsing, which is by far the most complex plug-in.
   It consists of:

   - diskimage_lvm2.ml
   - diskimage_lvm2.mli
     LVM2 probing, PV detection.

   - diskimage_lvm2_parser.mly
   - diskimage_lvm2_lexer.mll
     Scanner/parser for parsing LVM2 metadata definitions.

   - diskimage_lvm2_metadata.ml
   - diskimage_lvm2_metadata.mli
     AST for LVM2 metadata definitions.
