[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 1/2] qcow2-refcount: Snapshot update for zero
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v2 1/2] qcow2-refcount: Snapshot update for zero clusters |
Date: |
Fri, 30 Aug 2013 07:02:52 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8 |
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 <address@hidden>
> ---
> 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 <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature