[libvirt] [PATCH] Create raw storage files with O_DSYNC (again)

Recently we introduced O_DYSNC 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_DYSNC again. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/storage/storage_backend.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c index 8b9ed5d..3742493 100644 --- a/src/storage/storage_backend.c +++ b/src/storage/storage_backend.c @@ -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, -- 1.7.0

On Mon, Feb 22, 2010 at 12:32:05PM +0100, Jiri Denemark wrote:
Recently we introduced O_DYSNC 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_DYSNC again.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/storage/storage_backend.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c index 8b9ed5d..3742493 100644 --- a/src/storage/storage_backend.c +++ b/src/storage/storage_backend.c @@ -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,
Ah, right, ACK ! Please push :-) Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

Recently we introduced O_DYSNC 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_DYSNC again.
diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c index 8b9ed5d..3742493 100644 --- a/src/storage/storage_backend.c +++ b/src/storage/storage_backend.c @@ -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,
Ah, right, ACK !
Please push :-)
Thanks, pushed. I also fixed O_DYSNC typos in patch comment before pushing. Jirka

On 02/22/2010 06:32 AM, Jiri Denemark wrote:
Recently we introduced O_DYSNC 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.
Oops! Sorry about that! I guess missed it when resolving conflicts of a rebase.
Let's use O_DYSNC again.
Signed-off-by: Jiri Denemark<jdenemar@redhat.com> --- src/storage/storage_backend.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c index 8b9ed5d..3742493 100644 --- a/src/storage/storage_backend.c +++ b/src/storage/storage_backend.c @@ -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,
participants (3)
-
Daniel Veillard
-
Jiri Denemark
-
Laine Stump