]> git.proxmox.com Git - qemu.git/commit
qcow2: record fragmentation statistics during check
authorStefan Hajnoczi <stefanha@redhat.com>
Thu, 7 Feb 2013 16:15:02 +0000 (17:15 +0100)
committerKevin Wolf <kwolf@redhat.com>
Fri, 22 Feb 2013 20:21:09 +0000 (21:21 +0100)
commitfba31bae2d776fb4134186a830a252523df7933f
tree1f86478145230a7e3fb53a9df13f9f24e5142056
parent801f70445293ec8ed2d78fd92313c2f71fa48ac9
qcow2: record fragmentation statistics during check

The qemu-img check command can display fragmentation statistics:
 * Total number of clusters in virtual disk
 * Number of allocated clusters
 * Number of fragmented clusters

This patch adds fragmentation statistics support to qcow2.

Compressed and normal clusters count as allocated.  Zero clusters are
not counted as allocated unless their L2 entry has a non-zero offset
(e.g. preallocation).

Only the current L1 table counts towards the statistics - snapshots are
ignored.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block/qcow2-refcount.c