From: Jiri Denemark Date: Mon, 8 Feb 2010 15:10:02 +0000 (+0100) Subject: Create raw storage files with O_DSYNC X-Git-Tag: v0.7.7~212 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a82a87f26b0a6bacb53f3c7cd200a86a026ab6df;p=thirdparty%2Flibvirt.git 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. --- 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);