qemu-img check -r for repairing images

The QED block driver already provides the functionality to not only
detect inconsistencies in images, but also fix them. However, this
functionality cannot be manually invoked with qemu-img, but the
check happens only automatically during bdrv_open().

This adds a -r switch to qemu-img check that allows manual invocation
of an image repair.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Kevin Wolf 2012-05-11 16:07:02 +02:00
parent dfc65f1f78
commit 4534ff5426
9 changed files with 55 additions and 14 deletions

View file

@ -70,10 +70,15 @@ lists all snapshots in the given image
Command description:
@table @option
@item check [-f @var{fmt}] @var{filename}
@item check [-f @var{fmt}] [-r [leaks | all]] @var{filename}
Perform a consistency check on the disk image @var{filename}.
If @code{-r} is specified, qemu-img tries to repair any inconsistencies found
during the check. @code{-r leaks} repairs only cluster leaks, whereas
@code{-r all} fixes all kinds of errors, with a higher risk of choosing the
wrong fix or hiding corruption that has already occured.
Only the formats @code{qcow2}, @code{qed} and @code{vdi} support
consistency checks.