From 24530f3e060c71b6c57c7a70336f08a13a8b0a3d Mon Sep 17 00:00:00 2001 From: Max Reitz Date: Fri, 30 Aug 2013 14:34:30 +0200 Subject: [PATCH] qcow2_check: Mark image consistent If no corruptions remain after an image repair (and no errors have been encountered), clear the corrupt flag in qcow2_check. Signed-off-by: Max Reitz Signed-off-by: Kevin Wolf --- block/qcow2.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/block/qcow2.c b/block/qcow2.c index 05e002d85..4bc679a15 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -312,7 +312,11 @@ static int qcow2_check(BlockDriverState *bs, BdrvCheckResult *result, } if (fix && result->check_errors == 0 && result->corruptions == 0) { - return qcow2_mark_clean(bs); + ret = qcow2_mark_clean(bs); + if (ret < 0) { + return ret; + } + return qcow2_mark_consistent(bs); } return ret; } -- 2.39.5