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.
This commit is contained in:
Jiri Denemark 2010-02-08 16:10:02 +01:00
parent 5dee786d7b
commit a82a87f26b

View File

@ -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);