aboutsummaryrefslogtreecommitdiff
path: root/qemu-img.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2012-05-11 18:16:54 +0200
committerKevin Wolf <kwolf@redhat.com>2012-06-15 14:03:42 +0200
commitccf34716eeda0e3ad203c8a28f01efb412c56763 (patch)
tree46bb74acbf67d23a8586b1ce099cce15db363fc7 /qemu-img.c
parent4534ff5426afeeae5238ba10a696cafa9a0168ee (diff)
qemu-img check: Print fixed clusters and recheck
When any inconsistencies have been fixed, print the statistics and run another check to make sure everything is correct now. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'qemu-img.c')
-rw-r--r--qemu-img.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/qemu-img.c b/qemu-img.c
index c45ff62a28..9336c86d9e 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -425,6 +425,16 @@ static int img_check(int argc, char **argv)
return 1;
}
+ if (result.corruptions_fixed || result.leaks_fixed) {
+ printf("The following inconsistencies were found and repaired:\n\n"
+ " %d leaked clusters\n"
+ " %d corruptions\n\n"
+ "Double checking the fixed image now...\n",
+ result.leaks_fixed,
+ result.corruptions_fixed);
+ ret = bdrv_check(bs, &result, 0);
+ }
+
if (!(result.corruptions || result.leaks || result.check_errors)) {
printf("No errors were found on the image.\n");
} else {