libxc: Flush I/O before xc_domain_save completion
PATCH 1/1 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.
# HG changeset patch
# User Daniel Stodden <[email protected]> # 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.
tools/libxc/xc_domain_save.c +7 -0
@@ -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 ;
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel