From 1987530fe0fbe00970d572cd2eda5a149aac3333 Mon Sep 17 00:00:00 2001 From: aliguori Date: Thu, 22 Jan 2009 18:57:34 +0000 Subject: 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 Signed-off-by: Anthony Liguori git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6407 c046a42c-6fe2-441c-8c8c-71466251a162 --- block.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'block.c') diff --git a/block.c b/block.c index a3fcfa0157..50ec589587 100644 --- a/block.c +++ b/block.c @@ -1090,8 +1090,9 @@ void bdrv_info_stats (void) bs->rd_bytes, bs->wr_bytes, bs->rd_ops, bs->wr_ops); if (bdrv_get_info(bs, &bdi) == 0) - term_printf(" high=%" PRIu64, - bdi.highest_alloc); + term_printf(" high=%" PRId64 + " bytes_free=%" PRId64, + bdi.highest_alloc, bdi.num_free_bytes); term_printf("\n"); } } -- cgit v1.2.3