From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46520) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGPqg-00087K-Pw for qemu-devel@nongnu.org; Mon, 02 Sep 2013 04:51:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VGPqa-0005NC-EB for qemu-devel@nongnu.org; Mon, 02 Sep 2013 04:51:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53978) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGPqa-0005Mx-6a for qemu-devel@nongnu.org; Mon, 02 Sep 2013 04:50:56 -0400 From: Kevin Wolf Date: Mon, 2 Sep 2013 10:49:51 +0200 Message-Id: <1378111792-20436-26-git-send-email-kwolf@redhat.com> In-Reply-To: <1378111792-20436-1-git-send-email-kwolf@redhat.com> References: <1378111792-20436-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PULL v2 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