qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 07/22] qcow2: Helper function for refcount mo


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH v3 07/22] qcow2: Helper function for refcount modification
Date: Tue, 02 Dec 2014 10:57:09 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0

On 2014-11-28 at 12:11, Stefan Hajnoczi wrote:
On Thu, Nov 20, 2014 at 06:06:23PM +0100, Max Reitz wrote:
@@ -1711,7 +1746,7 @@ static int calculate_refcounts(BlockDriverState *bs, 
BdrvCheckResult *res,
  static void compare_refcounts(BlockDriverState *bs, BdrvCheckResult *res,
                                BdrvCheckMode fix, bool *rebuild,
                                int64_t *highest_cluster,
-                              uint16_t *refcount_table, int64_t nb_clusters)
+                              void *refcount_table, int64_t nb_clusters)
  {
      BDRVQcowState *s = bs->opaque;
      int64_t i, refcount1, refcount2;
An -ERANGE qcow2_get_refcount() return value is treated as a check error
here and we won't be able to rebuild the refcount blocks:

   refcount1 = qcow2_get_refcount(bs, i);
   if (refcount1 < 0) {
       fprintf(stderr, "Can't get refcount for cluster %" PRId64 ": %s\n",
           i, strerror(-refcount1));
       res->check_errors++;
       continue;
   }

We should allow rebuilding refcount blocks, -ERANGE is just another
corrupted refcount.

Right, hopefully this will be fixed by implementing your proposal for changing "uint64_t qcow2_get_refcount(...)" to "int qcow2_get_refcount(..., uint64_t *)" etc..

Max



reply via email to

[Prev in Thread] Current Thread [Next in Thread]