From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48688) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VFPjX-0000K9-8x for qemu-devel@nongnu.org; Fri, 30 Aug 2013 10:31:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VFPjR-0002oq-9U for qemu-devel@nongnu.org; Fri, 30 Aug 2013 10:31:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:18661) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VFPjR-0002oi-2t for qemu-devel@nongnu.org; Fri, 30 Aug 2013 10:31:25 -0400 From: Kevin Wolf Date: Fri, 30 Aug 2013 16:30:50 +0200 Message-Id: <1377873051-18981-26-git-send-email-kwolf@redhat.com> In-Reply-To: <1377873051-18981-1-git-send-email-kwolf@redhat.com> References: <1377873051-18981-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PULL 25/26] qcow2_check: Mark image consistent List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Max Reitz 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 05e002d..4bc679a 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; } -- 1.8.1.4