# HG changeset patch # User Daniel Stodden # Date 1270861240 25200 # Node ID 13337abe91dcaec26a22839c5f0629d310686712 # Parent aae7cb2f18411492c720d3b60adaa979858a63df libxc: Flush I/O before xc_domain_save completion. The final, flushing call to discard_file_cache also discards any errors from fsync. Call fsync explicitly before leaving, to check if all VM memory actually made it to the disk. Signed-off-by: Daniel Stodden diff -r aae7cb2f1841 -r 13337abe91dc tools/libxc/xc_domain_save.c --- a/tools/libxc/xc_domain_save.c Fri Apr 09 08:54:25 2010 +0100 +++ b/tools/libxc/xc_domain_save.c Fri Apr 09 18:00:40 2010 -0700 @@ -1764,6 +1764,13 @@ goto out; } + /* Flush last write and check for errors. */ + if ( fsync(io_fd) && errno != EINVAL ) + { + PERROR("Error when flushing state file"); + goto out; + } + /* Success! */ rc = 0;