qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH V3 3/7] qcow2: cancel the modification on fail i


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH V3 3/7] qcow2: cancel the modification on fail in qcow2_snapshot_create()
Date: Mon, 30 Sep 2013 15:24:27 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130923 Thunderbird/17.0.9

On 09/08/2013 08:57 PM, Wenchao Xia wrote:
> Signed-off-by: Wenchao Xia <address@hidden>
> ---
>  block/qcow2-snapshot.c |   20 ++++++++++++++++----
>  1 files changed, 16 insertions(+), 4 deletions(-)
> 

>  
> +restore_refcount:
> +    if (qcow2_update_snapshot_refcount(bs, s->l1_table_offset, s->l1_size, 
> -1)
> +        < 0) {
> +        /* Nothing can be done none now, need image check later */

s/none //

> +        error_report("qcow2: Error in restoring refcount in snapshot");
> +    }

Do we need to (attempt to) mark image metadata to mark the image
corrupted at this point?  Is it still wise to try and fall through to
freeing the clusters?

> +
> +dealloc_cluster:
> +    qcow2_free_clusters(bs, sn->l1_table_offset,
> +                        sn->l1_size * sizeof(uint64_t),
> +                        QCOW2_DISCARD_ALWAYS);
> +
>  fail:
>      g_free(sn->id_str);
>      g_free(sn->name);
> 

On the surface, this makes sense, but I'd rather defer the technical
review to someone more familiar with qcow2 code.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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