aboutsummaryrefslogtreecommitdiffstats
path: root/block.h
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-01-22 18:57:34 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-01-22 18:57:34 +0000
commit1987530fe0fbe00970d572cd2eda5a149aac3333 (patch)
tree6c12ca3999b605f5b47a1510691ebafe5010528d /block.h
parenta7cbfae0cf8c3c905236baec391f7a82540f1193 (diff)
qcow2 format: keep 'num_free_bytes', and show it upon 'info blockstats' (Uri Lublin)
'num_free_bytes' is the number of non-allocated bytes below highest-allocation. It's useful, together with the highest-allocation, to figure out how fragmented the image is, and how likely it will run out-of-space soon. For example when the highest allocation is high (almost end-of-disk), but many bytes (clusters) are free, and can be re-allocated when neeeded, than we know it's probably not going to reach end-of-disk-space soon. Added bookkeeping to block-qcow2.c Export it using BlockDeviceInfo Show it upon 'info blockstats' if BlockDeviceInfo exists Signed-off-by: Uri Lublin <uril@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6407 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'block.h')
-rw-r--r--block.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/block.h b/block.h
index 433407196..e1927dd1d 100644
--- a/block.h
+++ b/block.h
@@ -27,6 +27,7 @@ typedef struct BlockDriverInfo {
/* offset at which the VM state can be saved (0 if not possible) */
int64_t vm_state_offset;
int64_t highest_alloc; /* highest allocated block offset (in bytes) */
+ int64_t num_free_bytes; /* below highest_alloc */
} BlockDriverInfo;
typedef struct QEMUSnapshotInfo {