qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH V7 4/6] qcow2: cancel the modification on fail i


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH V7 4/6] qcow2: cancel the modification on fail in qcow2_snapshot_create()
Date: Thu, 2 Jan 2014 11:42:38 +0800
User-agent: Mutt/1.5.21 (2010-09-15)

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 following roll back operation. For snapshot create,
> the create action is:
> allocate new L1 -> refcount+1 -> allocate sn_list -> update header
> The mirrored rollback action can be:
> deallocate L1 <- refcount-1 <- deallocate sn_list <- restore header
> 
> When fail happens in rollback action, simply stop following ones.
> If you agree, I'd like to reorganize the patch as above.

I agree.  When the steps depend on each other we should skip further
operations when an error is returned in the failure path.  If the steps
are independent we can still safely clean up the independent parts.

Stefan



reply via email to

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