qcow2: Don't try to check tables that couldn't be loaded
authorKevin Wolf <kwolf@redhat.com>
Tue, 22 Jun 2010 10:35:07 +0000 (12:35 +0200)
committerKevin Wolf <kwolf@redhat.com>
Tue, 22 Jun 2010 12:38:02 +0000 (14:38 +0200)
Trying to check them leads to a second error message which is more confusing
than helpful:

    Can't get refcount for cluster 0: Invalid argument
    ERROR cluster 0 refcount=-22 reference=1

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/qcow2-refcount.c

index cedf57e996d61a48b801227893a1eb1b12b3acdc..4a96d986c96663a44b25988136c5afb2dc7d52f9 100644 (file)
@@ -1174,6 +1174,7 @@ int qcow2_check_refcounts(BlockDriverState *bs)
         if (refcount1 < 0) {
             fprintf(stderr, "Can't get refcount for cluster %d: %s\n",
                 i, strerror(-refcount1));
+            continue;
         }
 
         refcount2 = refcount_table[i];