summaryrefslogtreecommitdiff
path: root/qemu-common.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2009-09-04 19:01:32 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-09-11 10:19:46 -0500
commit6f1953c4c14566d3303709869fd26201828b3ccf (patch)
tree522dacdca726cc3b8bc321e70791d03a3b543e72 /qemu-common.h
parente900a7b748316b5b5a98e41dde36a0cb8e15be5f (diff)
block: use fdatasync instead of fsync if possible
If we are flushing the caches for our image files we only care about the data (including the metadata required for accessing it) but not things like timestamp updates. So try to use fdatasync instead of fsync to implement the flush operations. Unfortunately many operating systems still do not support fdatasync, so we add a qemu_fdatasync wrapper that uses fdatasync if available as per the _POSIX_SYNCHRONIZED_IO feature macro or fsync otherwise. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'qemu-common.h')
-rw-r--r--qemu-common.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/qemu-common.h b/qemu-common.h
index f3cfb683ea..12e7dd0ada 100644
--- a/qemu-common.h
+++ b/qemu-common.h
@@ -114,6 +114,7 @@ int stristart(const char *str, const char *val, const char **ptr);
int qemu_strnlen(const char *s, int max_len);
time_t mktimegm(struct tm *tm);
int qemu_fls(int i);
+int qemu_fdatasync(int fd);
/* path.c */
void init_paths(const char *prefix);