From: Stefan Hajnoczi <stefanha@gmail.com>
To: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Cc: kwolf@redhat.com, pbonzini@redhat.com, aliguori@us.ibm.com,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/2] qcow2: cancel the modification on fail in qcow2_snapshot_create()
Date: Thu, 16 May 2013 11:34:07 +0200 [thread overview]
Message-ID: <20130516093407.GC8853@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1368607419-15178-2-git-send-email-xiawenc@linux.vnet.ibm.com>
On Wed, May 15, 2013 at 04:43:39PM +0800, Wenchao Xia wrote:
> Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
> ---
> block/qcow2-snapshot.c | 11 +++++++++++
> 1 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/block/qcow2-snapshot.c b/block/qcow2-snapshot.c
> index a6065a9..ad030f9 100644
> --- a/block/qcow2-snapshot.c
> +++ b/block/qcow2-snapshot.c
> @@ -410,6 +410,17 @@ int qcow2_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
> #endif
> return 0;
>
> +restore_refcount:
> + ret = qcow2_update_snapshot_refcount(bs, s->l1_table_offset,
> + s->l1_size, -1);
> + if (ret < 0) {
> + /* Nothing can be done none now, need image check later */
> + error_report("qcow2: Error in restoring refcount in snapshot");
> + }
> +
> +dealloc_cluster:
> + qcow2_free_clusters(bs, sn->l1_table_offset, sn->l1_size);
> +
> fail:
> g_free(sn->id_str);
> g_free(sn->name);
This patch is missing goto restore_refcount and goto dealloc_cluster.
next prev parent reply other threads:[~2013-05-16 9:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-15 8:43 [Qemu-devel] [PATCH 1/2] qcow2: free allocated cluster on fail in qcow2_write_snapshots() Wenchao Xia
2013-05-15 8:43 ` [Qemu-devel] [PATCH 2/2] qcow2: cancel the modification on fail in qcow2_snapshot_create() Wenchao Xia
2013-05-16 9:34 ` Stefan Hajnoczi [this message]
2013-05-16 9:32 ` [Qemu-devel] [PATCH 1/2] qcow2: free allocated cluster on fail in qcow2_write_snapshots() Stefan Hajnoczi
2013-05-17 4:58 ` Wenchao Xia
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130516093407.GC8853@stefanha-thinkpad.redhat.com \
--to=stefanha@gmail.com \
--cc=aliguori@us.ibm.com \
--cc=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=xiawenc@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.