From a82a87f26b0a6bacb53f3c7cd200a86a026ab6df Mon Sep 17 00:00:00 2001 From: Jiri Denemark Date: Mon, 8 Feb 2010 16:10:02 +0100 Subject: [PATCH] Create raw storage files with O_DSYNC When creating preallocated large raw files opening them with O_DSYNC prevents long delays in reading because cache pages can be immediately reused without writing them on a disk first. --- src/storage/storage_backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c index 8d85de8a11..4c62d48477 100644 --- a/src/storage/storage_backend.c +++ b/src/storage/storage_backend.c @@ -300,7 +300,7 @@ virStorageBackendCreateRaw(virConnectPtr conn, goto cleanup; } - if ((fd = open(vol->target.path, O_RDWR | O_EXCL)) < 0) { + if ((fd = open(vol->target.path, O_RDWR | O_EXCL | O_DSYNC)) < 0) { virReportSystemError(errno, _("cannot open new path '%s'"), vol->target.path);