]> git.ipfire.org Git - thirdparty/libvirt.git/commit
iohelper: fdatasync() at the end
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 30 Oct 2012 18:15:48 +0000 (19:15 +0100)
committerCole Robinson <crobinso@redhat.com>
Sun, 9 Dec 2012 21:11:09 +0000 (16:11 -0500)
commit8a95078f98804bb934cd0795dbf4ffceb25744ef
tree41c1b9506f79da9d6e4c294dcbde52c4dd0b5f02
parentec3f5cad8e6ca15bd1cdff6518109a1c751544b4
iohelper: fdatasync() at the end

Currently, when we are doing (managed) save, we insert the
iohelper between the qemu and OS. The pipe is created, the
writing end is passed to qemu and the reading end to the
iohelper. It reads data and write them into given file. However,
with write() being asynchronous data may still be in OS
caches and hence in some (corner) cases, all migration data
may have been read and written (not physically though). So
qemu will report success, as well as iohelper. However, with
some non local filesystems, where ENOSPACE is polled every X
time units, we may get into situation where all operations
succeeded but data hasn't reached the disk. And in fact will
never do. Therefore we ought sync caches to make sure data
has reached the block device on remote host.
(cherry picked from commit f32e3a2dd686f3692cd2bd3147c03e90f82df987)
src/util/iohelper.c