[libvirt] [PATCH] Create raw storage files with O_DSYNC

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

 



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@xxxxxxxxxx>
---
 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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]