From f8111c241afa75544032dcfa23df0699c91f9866 Mon Sep 17 00:00:00 2001 From: Dong Xu Wang Date: Thu, 15 Mar 2012 20:13:31 +0800 Subject: qemu-img: add image fragmentation statistics Discussion can be found at: http://patchwork.ozlabs.org/patch/128730/ This patch add image fragmentation statistics while using qemu-img check. Signed-off-by: Dong Xu Wang Reviewed-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- block.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'block.h') diff --git a/block.h b/block.h index c51ab163d9..ea12f5df30 100644 --- a/block.h +++ b/block.h @@ -17,6 +17,12 @@ typedef struct BlockDriverInfo { int64_t vm_state_offset; } BlockDriverInfo; +typedef struct BlockFragInfo { + uint64_t allocated_clusters; + uint64_t total_clusters; + uint64_t fragmented_clusters; +} BlockFragInfo; + typedef struct QEMUSnapshotInfo { char id_str[128]; /* unique snapshot id */ /* the following fields are informative. They are not needed for @@ -175,6 +181,7 @@ typedef struct BdrvCheckResult { int corruptions; int leaks; int check_errors; + BlockFragInfo bfi; } BdrvCheckResult; int bdrv_check(BlockDriverState *bs, BdrvCheckResult *res); -- cgit v1.2.3-55-g7522