[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [qemu] Make sure disk writes really made it to disk before we report I/O



# HG changeset patch
# User chris@xxxxxxxxxxxxxxxxxxxxxxxx
# Node ID 3ea0a6847198d0c448cb19f2e95bee9e0b48ae59
# Parent  cf00bca7c6e1e4d334f3a67ba7bcb5dfeb6e9af4
[qemu] Make sure disk writes really made it to disk before we report I/O
completion to the guest domain.  The DMA_MULTI_THREAD functionality
from the qemu-dm IDE emulation should make the performance overhead
of synchronous writes bearable, or at least comparable to native
hardware.

Signed-off-by: Rik van Riel <riel@xxxxxxxxxx>
---
 tools/ioemu/block-bochs.c |    2 +-
 tools/ioemu/block-cloop.c |    2 +-
 tools/ioemu/block-cow.c   |    2 +-
 tools/ioemu/block-qcow.c  |    2 +-
 tools/ioemu/block-vmdk.c  |    2 +-
 tools/ioemu/block.c       |    2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff -r cf00bca7c6e1 -r 3ea0a6847198 tools/ioemu/block-bochs.c
--- a/tools/ioemu/block-bochs.c Fri Aug 04 10:20:33 2006 +0100
+++ b/tools/ioemu/block-bochs.c Fri Aug 04 10:28:51 2006 +0100
@@ -91,7 +91,7 @@ static int bochs_open(BlockDriverState *
     int fd, i;
     struct bochs_header bochs;
 
-    fd = open(filename, O_RDWR | O_BINARY | O_LARGEFILE);
+    fd = open(filename, O_RDWR | O_BINARY | O_LARGEFILE | O_SYNC);
     if (fd < 0) {
         fd = open(filename, O_RDONLY | O_BINARY | O_LARGEFILE);
         if (fd < 0)
diff -r cf00bca7c6e1 -r 3ea0a6847198 tools/ioemu/block-cloop.c
--- a/tools/ioemu/block-cloop.c Fri Aug 04 10:20:33 2006 +0100
+++ b/tools/ioemu/block-cloop.c Fri Aug 04 10:28:51 2006 +0100
@@ -55,7 +55,7 @@ static int cloop_open(BlockDriverState *
     BDRVCloopState *s = bs->opaque;
     uint32_t offsets_size,max_compressed_block_size=1,i;
 
-    s->fd = open(filename, O_RDONLY | O_BINARY | O_LARGEFILE);
+    s->fd = open(filename, O_RDONLY | O_BINARY | O_LARGEFILE | O_SYNC);
     if (s->fd < 0)
         return -1;
     bs->read_only = 1;
diff -r cf00bca7c6e1 -r 3ea0a6847198 tools/ioemu/block-cow.c
--- a/tools/ioemu/block-cow.c   Fri Aug 04 10:20:33 2006 +0100
+++ b/tools/ioemu/block-cow.c   Fri Aug 04 10:28:51 2006 +0100
@@ -69,7 +69,7 @@ static int cow_open(BlockDriverState *bs
     struct cow_header_v2 cow_header;
     int64_t size;
 
-    fd = open(filename, O_RDWR | O_BINARY | O_LARGEFILE);
+    fd = open(filename, O_RDWR | O_BINARY | O_LARGEFILE | O_SYNC);
     if (fd < 0) {
         fd = open(filename, O_RDONLY | O_BINARY | O_LARGEFILE);
         if (fd < 0)
diff -r cf00bca7c6e1 -r 3ea0a6847198 tools/ioemu/block-qcow.c
--- a/tools/ioemu/block-qcow.c  Fri Aug 04 10:20:33 2006 +0100
+++ b/tools/ioemu/block-qcow.c  Fri Aug 04 10:28:51 2006 +0100
@@ -95,7 +95,7 @@ static int qcow_open(BlockDriverState *b
     int fd, len, i, shift;
     QCowHeader header;
     
-    fd = open(filename, O_RDWR | O_BINARY | O_LARGEFILE);
+    fd = open(filename, O_RDWR | O_BINARY | O_LARGEFILE | O_SYNC);
     if (fd < 0) {
         fd = open(filename, O_RDONLY | O_BINARY | O_LARGEFILE);
         if (fd < 0)
diff -r cf00bca7c6e1 -r 3ea0a6847198 tools/ioemu/block-vmdk.c
--- a/tools/ioemu/block-vmdk.c  Fri Aug 04 10:20:33 2006 +0100
+++ b/tools/ioemu/block-vmdk.c  Fri Aug 04 10:28:51 2006 +0100
@@ -96,7 +96,7 @@ static int vmdk_open(BlockDriverState *b
     uint32_t magic;
     int l1_size;
 
-    fd = open(filename, O_RDWR | O_BINARY | O_LARGEFILE);
+    fd = open(filename, O_RDWR | O_BINARY | O_LARGEFILE | O_SYNC);
     if (fd < 0) {
         fd = open(filename, O_RDONLY | O_BINARY | O_LARGEFILE);
         if (fd < 0)
diff -r cf00bca7c6e1 -r 3ea0a6847198 tools/ioemu/block.c
--- a/tools/ioemu/block.c       Fri Aug 04 10:20:33 2006 +0100
+++ b/tools/ioemu/block.c       Fri Aug 04 10:28:51 2006 +0100
@@ -677,7 +677,7 @@ static int raw_open(BlockDriverState *bs
     int rv;
 #endif
 
-    fd = open(filename, O_RDWR | O_BINARY | O_LARGEFILE);
+    fd = open(filename, O_RDWR | O_BINARY | O_LARGEFILE | O_SYNC);
     if (fd < 0) {
         fd = open(filename, O_RDONLY | O_BINARY | O_LARGEFILE);
         if (fd < 0)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.