Re: [libvirt] [PATCH 2/4] Introduce virFileRewrite for safe file rewrite

2011-10-27 Thread Eric Blake
On 10/26/2011 03:16 PM, Jiri Denemark wrote: On Mon, Oct 24, 2011 at 16:48:58 -0600, Eric Blake wrote: On 10/19/2011 11:26 AM, Jiri Denemark wrote: When saving config files we just overwrite old content of the file. In case something fails during that process (e.g. disk gets full) we lose both

Re: [libvirt] [PATCH 2/4] Introduce virFileRewrite for safe file rewrite

2011-10-26 Thread Jiri Denemark
On Mon, Oct 24, 2011 at 16:48:58 -0600, Eric Blake wrote: On 10/19/2011 11:26 AM, Jiri Denemark wrote: When saving config files we just overwrite old content of the file. In case something fails during that process (e.g. disk gets full) we lose both old and new content. This patch makes the

Re: [libvirt] [PATCH 2/4] Introduce virFileRewrite for safe file rewrite

2011-10-24 Thread Eric Blake
On 10/19/2011 11:26 AM, Jiri Denemark wrote: When saving config files we just overwrite old content of the file. In case something fails during that process (e.g. disk gets full) we lose both old and new content. This patch makes the process more robust by writing the new content into a separate

Re: [libvirt] [PATCH 2/4] Introduce virFileRewrite for safe file rewrite

2011-10-20 Thread Daniel P. Berrange
On Wed, Oct 19, 2011 at 07:26:25PM +0200, Jiri Denemark wrote: When saving config files we just overwrite old content of the file. In case something fails during that process (e.g. disk gets full) we lose both old and new content. This patch makes the process more robust by writing the new

[libvirt] [PATCH 2/4] Introduce virFileRewrite for safe file rewrite

2011-10-19 Thread Jiri Denemark
When saving config files we just overwrite old content of the file. In case something fails during that process (e.g. disk gets full) we lose both old and new content. This patch makes the process more robust by writing the new content into a separate file and only if that succeeds the original