]> git.proxmox.com Git - mirror_qemu.git/commitdiff
qcow2_check: Mark image consistent
authorMax Reitz <mreitz@redhat.com>
Fri, 30 Aug 2013 12:34:30 +0000 (14:34 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 2 Sep 2013 08:15:15 +0000 (10:15 +0200)
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 <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/qcow2.c

index 05e002d856e87b5e0698cb166109821dafaaf9b8..4bc679a155f5dde9201e924204edfc8134a29db6 100644 (file)
@@ -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;
 }