]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Create raw storage files with O_DSYNC (again)
authorJiri Denemark <jdenemar@redhat.com>
Mon, 22 Feb 2010 11:24:02 +0000 (12:24 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Mon, 22 Feb 2010 13:54:17 +0000 (14:54 +0100)
Recently we introduced O_DSYNC flag when creating raw storage files to
avoid filling all disk cache with dirty pages. However, the patch got
lost when virStorageBackendCreateRaw was reworked using
virFileOperation. Let's use O_DSYNC again.

src/storage/storage_backend.c

index 8b9ed5d3935471817964ecf8754f8351f3b7168e..374249334e318e0fcda6298408566abd5e354085 100644 (file)
@@ -356,7 +356,8 @@ virStorageBackendCreateRaw(virConnectPtr conn ATTRIBUTE_UNUSED,
         goto cleanup;
     }
 
-    if ((createstat = virFileOperation(vol->target.path, O_RDWR | O_CREAT | O_EXCL,
+    if ((createstat = virFileOperation(vol->target.path,
+                                       O_RDWR | O_CREAT | O_EXCL | O_DSYNC,
                                        vol->target.perms.mode,
                                        vol->target.perms.uid, vol->target.perms.gid,
                                        createRawFileOpHook, &hdata,