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

2014-12-02 Thread Max Reitz
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,

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

2014-12-02 Thread Max Reitz
On 2014-11-28 at 12:26, Stefan Hajnoczi wrote: On Thu, Nov 27, 2014 at 04:32:52PM +0100, Max Reitz wrote: On 2014-11-27 at 16:21, Stefan Hajnoczi wrote: On Thu, Nov 20, 2014 at 06:06:23PM +0100, Max Reitz wrote: @@ -583,7 +608,12 @@ static int QEMU_WARN_UNUSED_RESULT update_refcount(BlockDriv

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

2014-11-28 Thread Stefan Hajnoczi
On Thu, Nov 27, 2014 at 04:32:52PM +0100, Max Reitz wrote: > On 2014-11-27 at 16:21, Stefan Hajnoczi wrote: > >On Thu, Nov 20, 2014 at 06:06:23PM +0100, Max Reitz wrote: > >>@@ -583,7 +608,12 @@ static int QEMU_WARN_UNUSED_RESULT > >>update_refcount(BlockDriverState *bs, > >> /* we can up

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

2014-11-28 Thread Stefan Hajnoczi
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 *reb

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

2014-11-27 Thread Max Reitz
On 2014-11-27 at 16:21, Stefan Hajnoczi wrote: On Thu, Nov 20, 2014 at 06:06:23PM +0100, Max Reitz wrote: @@ -116,20 +137,24 @@ int64_t qcow2_get_refcount(BlockDriverState *bs, int64_t cluster_index) } ret = qcow2_cache_get(bs, s->refcount_block_cache, refcount_block_offset, -

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

2014-11-27 Thread Stefan Hajnoczi
On Thu, Nov 20, 2014 at 06:06:23PM +0100, Max Reitz wrote: > @@ -116,20 +137,24 @@ int64_t qcow2_get_refcount(BlockDriverState *bs, > int64_t cluster_index) > } > > ret = qcow2_cache_get(bs, s->refcount_block_cache, refcount_block_offset, > -(void**) &refcount_block); > +

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

2014-11-20 Thread Eric Blake
On 11/20/2014 10:06 AM, Max Reitz wrote: > Since refcounts do not always have to be a uint16_t, all refcount blocks > and arrays in memory should not have a specific type (thus they become > pointers to void) and for accessing them, two helper functions are used > (a getter and a setter). Those fun

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

2014-11-20 Thread Max Reitz
Since refcounts do not always have to be a uint16_t, all refcount blocks and arrays in memory should not have a specific type (thus they become pointers to void) and for accessing them, two helper functions are used (a getter and a setter). Those functions are called indirectly through function poi