Re: [libvirt] [PATCH] qemu: Do not unlink managedsave image if restoring fails.

2011-04-06 Thread Daniel Veillard
On Tue, Apr 05, 2011 at 08:55:01AM -0600, Eric Blake wrote: On 04/05/2011 07:20 AM, Jiri Denemark wrote: On Tue, Apr 05, 2011 at 14:47:22 +0800, Osier Yang wrote: Both qemuDomainStartWithFlags and qemuAutostartDomain try to restore the domain from managedsave'ed image if it exists (by

Re: [libvirt] [PATCH] qemu: Do not unlink managedsave image if restoring fails.

2011-04-06 Thread Osier Yang
于 2011年04月06日 16:50, Daniel Veillard 写道: On Tue, Apr 05, 2011 at 08:55:01AM -0600, Eric Blake wrote: On 04/05/2011 07:20 AM, Jiri Denemark wrote: On Tue, Apr 05, 2011 at 14:47:22 +0800, Osier Yang wrote: Both qemuDomainStartWithFlags and qemuAutostartDomain try to restore the domain from

Re: [libvirt] [PATCH] qemu: Do not unlink managedsave image if restoring fails.

2011-04-06 Thread Daniel Veillard
On Wed, Apr 06, 2011 at 05:02:36PM +0800, Osier Yang wrote: 于 2011年04月06日 16:50, Daniel Veillard 写道: On Tue, Apr 05, 2011 at 08:55:01AM -0600, Eric Blake wrote: should leave file intact if and only if the restore failed, and: The problem there is that you are changing the command

Re: [libvirt] [PATCH] qemu: Do not unlink managedsave image if restoring fails.

2011-04-06 Thread Daniel Berteaud
Le mercredi 06 avril 2011 à 16:50 +0800, Daniel Veillard a écrit : That is, I think: virsh save dom file virsh restore file should leave file intact if and only if the restore failed, and: The problem there is that you are changing the command behaviour. The user may

Re: [libvirt] [PATCH] qemu: Do not unlink managedsave image if restoring fails.

2011-04-06 Thread Eric Blake
On 04/06/2011 06:51 AM, Daniel Veillard wrote: On Wed, Apr 06, 2011 at 05:02:36PM +0800, Osier Yang wrote: 于 2011年04月06日 16:50, Daniel Veillard 写道: On Tue, Apr 05, 2011 at 08:55:01AM -0600, Eric Blake wrote: should leave file intact if and only if the restore failed, and: The problem there

Re: [libvirt] [PATCH] qemu: Do not unlink managedsave image if restoring fails.

2011-04-06 Thread Eric Blake
On 04/06/2011 07:11 AM, Daniel Berteaud wrote: The problem there is that you are changing the command behaviour. The user may snapshot the disk separately and use this to implement a simplified domain snapshot. Doing the remove may avoid troubles for those not knowing what they are doing,

Re: [libvirt] [PATCH] qemu: Do not unlink managedsave image if restoring fails.

2011-04-06 Thread Osier Yang
于 2011年04月06日 22:21, Eric Blake 写道: On 04/06/2011 06:51 AM, Daniel Veillard wrote: On Wed, Apr 06, 2011 at 05:02:36PM +0800, Osier Yang wrote: 于 2011年04月06日 16:50, Daniel Veillard 写道: On Tue, Apr 05, 2011 at 08:55:01AM -0600, Eric Blake wrote: should leave file intact if and only if the

Re: [libvirt] [PATCH] qemu: Do not unlink managedsave image if restoring fails.

2011-04-06 Thread Osier Yang
于 2011年04月06日 22:25, Eric Blake 写道: On 04/06/2011 07:11 AM, Daniel Berteaud wrote: The problem there is that you are changing the command behaviour. The user may snapshot the disk separately and use this to implement a simplified domain snapshot. Doing the remove may avoid troubles for those

Re: [libvirt] [PATCH] qemu: Do not unlink managedsave image if restoring fails.

2011-04-06 Thread Osier Yang
于 2011年04月06日 22:25, Eric Blake 写道: On 04/06/2011 07:11 AM, Daniel Berteaud wrote: The problem there is that you are changing the command behaviour. The user may snapshot the disk separately and use this to implement a simplified domain snapshot. Doing the remove may avoid troubles for those

Re: [libvirt] [PATCH] qemu: Do not unlink managedsave image if restoring fails.

2011-04-06 Thread Daniel Veillard
On Wed, Apr 06, 2011 at 08:21:56AM -0600, Eric Blake wrote: On 04/06/2011 06:51 AM, Daniel Veillard wrote: On Wed, Apr 06, 2011 at 05:02:36PM +0800, Osier Yang wrote: 于 2011年04月06日 16:50, Daniel Veillard 写道: On Tue, Apr 05, 2011 at 08:55:01AM -0600, Eric Blake wrote: Somehow this is

[libvirt] [PATCH] qemu: Do not unlink managedsave image if restoring fails.

2011-04-05 Thread Osier Yang
Both qemuDomainStartWithFlags and qemuAutostartDomain try to restore the domain from managedsave'ed image if it exists (by invoking qemuDomainObjRestore), but it unlinks the image even if restoring fails, which causes data loss. However, I'm not sure if it's the very correct way to fix it, if

Re: [libvirt] [PATCH] qemu: Do not unlink managedsave image if restoring fails.

2011-04-05 Thread Jiri Denemark
On Tue, Apr 05, 2011 at 14:47:22 +0800, Osier Yang wrote: Both qemuDomainStartWithFlags and qemuAutostartDomain try to restore the domain from managedsave'ed image if it exists (by invoking qemuDomainObjRestore), but it unlinks the image even if restoring fails, which causes data loss.

Re: [libvirt] [PATCH] qemu: Do not unlink managedsave image if restoring fails.

2011-04-05 Thread Osier Yang
于 2011年04月05日 21:20, Jiri Denemark 写道: On Tue, Apr 05, 2011 at 14:47:22 +0800, Osier Yang wrote: Both qemuDomainStartWithFlags and qemuAutostartDomain try to restore the domain from managedsave'ed image if it exists (by invoking qemuDomainObjRestore), but it unlinks the image even if restoring

Re: [libvirt] [PATCH] qemu: Do not unlink managedsave image if restoring fails.

2011-04-05 Thread Osier Yang
于 2011年04月05日 22:55, Eric Blake 写道: On 04/05/2011 07:20 AM, Jiri Denemark wrote: On Tue, Apr 05, 2011 at 14:47:22 +0800, Osier Yang wrote: Both qemuDomainStartWithFlags and qemuAutostartDomain try to restore the domain from managedsave'ed image if it exists (by invoking qemuDomainObjRestore),