[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [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.

Signed-off-by: Jiri Denemark <jdenemar redhat com>
---
 src/storage/storage_backend.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c
index e79294a..8aab9ab 100644
--- a/src/storage/storage_backend.c
+++ b/src/storage/storage_backend.c
@@ -301,7 +301,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(conn, errno,
                              _("cannot open new path '%s'"),
                              vol->target.path);
-- 
1.6.6.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]