Re: [Qemu-devel] [PATCH V7 4/6] qcow2: cancel the modification on fail in qcow2_snapshot_create()

2014-01-01 Thread Stefan Hajnoczi
On Mon, Dec 23, 2013 at 02:12:56PM +0800, Wenchao Xia wrote: > I have reconsidered the roll back process, there is many case we > should take care, so it is better to summarize a general rule to do such > cancel operations. I suggest: do a series of roll back operations, > when one fail, skip fol

Re: [Qemu-devel] [PATCH V7 4/6] qcow2: cancel the modification on fail in qcow2_snapshot_create()

2013-12-22 Thread Wenchao Xia
于 2013/12/23 10:57, Wenchao Xia 写道: 于 2013/12/20 22:20, Stefan Hajnoczi 写道: On Thu, Dec 05, 2013 at 08:02:50PM +0800, Wenchao Xia wrote: +restore_refcount: +if (qcow2_update_snapshot_refcount(bs, s->l1_table_offset, s->l1_size, -1) +< 0 && errp) { +/* Nothing can be done now

Re: [Qemu-devel] [PATCH V7 4/6] qcow2: cancel the modification on fail in qcow2_snapshot_create()

2013-12-22 Thread Wenchao Xia
于 2013/12/20 22:20, Stefan Hajnoczi 写道: On Thu, Dec 05, 2013 at 08:02:50PM +0800, Wenchao Xia wrote: +restore_refcount: +if (qcow2_update_snapshot_refcount(bs, s->l1_table_offset, s->l1_size, -1) +< 0 && errp) { +/* Nothing can be done now, need image check later */ +

Re: [Qemu-devel] [PATCH V7 4/6] qcow2: cancel the modification on fail in qcow2_snapshot_create()

2013-12-20 Thread Stefan Hajnoczi
On Thu, Dec 05, 2013 at 08:02:50PM +0800, Wenchao Xia wrote: > +restore_refcount: > +if (qcow2_update_snapshot_refcount(bs, s->l1_table_offset, s->l1_size, > -1) > +< 0 && errp) { > +/* Nothing can be done now, need image check later */ > +error_setg(&err, "%s\nqcow2: E

[Qemu-devel] [PATCH V7 4/6] qcow2: cancel the modification on fail in qcow2_snapshot_create()

2013-12-05 Thread Wenchao Xia
Signed-off-by: Wenchao Xia Reviewed-by: Max Reitz --- block/qcow2-snapshot.c | 25 + 1 files changed, 21 insertions(+), 4 deletions(-) diff --git a/block/qcow2-snapshot.c b/block/qcow2-snapshot.c index 55746c4..5f787bc 100644 --- a/block/qcow2-snapshot.c +++ b/block/qc