Changing copyright notice for new year.
[virt-top.git] / virt-df / README
1 virt-df is a 'df' tool for printing out the used and available disk
2 space in all active and inactive domains.  Without this tool you would
3 need to log in to each domain individually or set up monitoring.
4
5 It is only a proof-of-concept.  Please bare in mind the following
6 limitations when using this tool:
7
8 (1) It does not work over remote connections.  Part of the reason why
9 I wrote virt-df was to get an idea of how the remote storage API for
10 libvirt might look.
11
12 (2) It only understands a limited set of partition types.  Assuming
13 that the files and partitions that we get back from libvirt / Xen
14 correspond to block devices in the guests, we can go some way towards
15 manually parsing those partitions to find out what they contain.  We
16 can read the MBR, LVM, superblocks and so on.  However that's a lot of
17 parsing work, and currently there is no library which understands a
18 wide range of partition schemes and filesystem types (not even
19 libparted which doesn't support LVM yet).  The Linux kernel does
20 support that, but there's not really any good way to access that work.
21
22 The current implementation uses a hand-coded parser which understands
23 some simple formats (MBR, LVM2, ext2/3).  In future we should use
24 something like libparted.
25
26 (3) The statistics you get are delayed.  The real state of, for
27 example, an ext2 filesystem is only stored in the memory of the
28 guest's kernel.  The ext2 superblock contains some meta-information
29 about blocks used and free, but this superblock is not up to date.  In
30 fact the guest kernel may not update it even on a 'sync', not until
31 the filesystem is unmounted.  Some operations do appear to write the
32 superblock, for example fsync(2) [that is my reading of the ext2/3
33 source code at least].