On 08/30/2013 02:36 AM, Max Reitz wrote: > Account for all cluster types in qcow2_update_snapshot_refcounts; > this prevents this function from updating the refcount of unallocated > zero clusters which effectively led to wrong adjustments of the refcount > of cluster 0 (the main qcow2 header). This in turn resulted in images > with (unallocated) zero clusters having a cluster 0 refcount greater > than one after creating a snapshot. > > Signed-off-by: Max Reitz <mre...@redhat.com> > --- > block/qcow2-refcount.c | 52 > +++++++++++++++++++++++++++++++++----------------- > 1 file changed, 35 insertions(+), 17 deletions(-) > > diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c > index 1244693..a61224a 100644 > --- a/block/qcow2-refcount.c > +++ b/block/qcow2-refcount.c > @@ -861,11 +861,14 @@ int qcow2_update_snapshot_refcount(BlockDriverState *bs, > } > > for(j = 0; j < s->l2_size; j++) { > + uint64_t cluster_index;
As long as you're touching this code, it might be worth s/for(/for (/ in the line above. Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature