diff options
author | Kevin Wolf | 2012-05-11 18:16:54 +0200 |
---|---|---|
committer | Kevin Wolf | 2012-06-15 14:03:42 +0200 |
commit | ccf34716eeda0e3ad203c8a28f01efb412c56763 (patch) | |
tree | 46bb74acbf67d23a8586b1ce099cce15db363fc7 /qemu-img.c | |
parent | qemu-img check -r for repairing images (diff) | |
download | qemu-ccf34716eeda0e3ad203c8a28f01efb412c56763.tar.gz qemu-ccf34716eeda0e3ad203c8a28f01efb412c56763.tar.xz qemu-ccf34716eeda0e3ad203c8a28f01efb412c56763.zip |
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.c | 10 |
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 { |