From 4534ff5426afeeae5238ba10a696cafa9a0168ee Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Fri, 11 May 2012 16:07:02 +0200 Subject: 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 --- block/qed.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'block/qed.c') diff --git a/block/qed.c b/block/qed.c index 30a31f9..ab59724 100644 --- a/block/qed.c +++ b/block/qed.c @@ -1517,11 +1517,12 @@ static void bdrv_qed_invalidate_cache(BlockDriverState *bs) bdrv_qed_open(bs, bs->open_flags); } -static int bdrv_qed_check(BlockDriverState *bs, BdrvCheckResult *result) +static int bdrv_qed_check(BlockDriverState *bs, BdrvCheckResult *result, + BdrvCheckMode fix) { BDRVQEDState *s = bs->opaque; - return qed_check(s, result, false); + return qed_check(s, result, !!fix); } static QEMUOptionParameter qed_create_options[] = { -- cgit v1.1