mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
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:
parent
5dee786d7b
commit
a82a87f26b
@ -300,7 +300,7 @@ virStorageBackendCreateRaw(virConnectPtr conn,
|
|||||||
goto cleanup;
|
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,
|
virReportSystemError(errno,
|
||||||
_("cannot open new path '%s'"),
|
_("cannot open new path '%s'"),
|
||||||
vol->target.path);
|
vol->target.path);
|
||||||
|
Loading…
Reference in New Issue
Block a user