direct-io.hg

changeset 10931:3ea0a6847198

[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@redhat.com>
author chris@kneesaa.uk.xensource.com
date Fri Aug 04 10:28:51 2006 +0100 (2006-08-04)
parents cf00bca7c6e1
children c6b2761633c6
files tools/ioemu/block-bochs.c tools/ioemu/block-cloop.c tools/ioemu/block-cow.c tools/ioemu/block-qcow.c tools/ioemu/block-vmdk.c tools/ioemu/block.c
line diff
     1.1 --- a/tools/ioemu/block-bochs.c	Fri Aug 04 10:20:33 2006 +0100
     1.2 +++ b/tools/ioemu/block-bochs.c	Fri Aug 04 10:28:51 2006 +0100
     1.3 @@ -91,7 +91,7 @@ static int bochs_open(BlockDriverState *
     1.4      int fd, i;
     1.5      struct bochs_header bochs;
     1.6  
     1.7 -    fd = open(filename, O_RDWR | O_BINARY | O_LARGEFILE);
     1.8 +    fd = open(filename, O_RDWR | O_BINARY | O_LARGEFILE | O_SYNC);
     1.9      if (fd < 0) {
    1.10          fd = open(filename, O_RDONLY | O_BINARY | O_LARGEFILE);
    1.11          if (fd < 0)
     2.1 --- a/tools/ioemu/block-cloop.c	Fri Aug 04 10:20:33 2006 +0100
     2.2 +++ b/tools/ioemu/block-cloop.c	Fri Aug 04 10:28:51 2006 +0100
     2.3 @@ -55,7 +55,7 @@ static int cloop_open(BlockDriverState *
     2.4      BDRVCloopState *s = bs->opaque;
     2.5      uint32_t offsets_size,max_compressed_block_size=1,i;
     2.6  
     2.7 -    s->fd = open(filename, O_RDONLY | O_BINARY | O_LARGEFILE);
     2.8 +    s->fd = open(filename, O_RDONLY | O_BINARY | O_LARGEFILE | O_SYNC);
     2.9      if (s->fd < 0)
    2.10          return -1;
    2.11      bs->read_only = 1;
     3.1 --- a/tools/ioemu/block-cow.c	Fri Aug 04 10:20:33 2006 +0100
     3.2 +++ b/tools/ioemu/block-cow.c	Fri Aug 04 10:28:51 2006 +0100
     3.3 @@ -69,7 +69,7 @@ static int cow_open(BlockDriverState *bs
     3.4      struct cow_header_v2 cow_header;
     3.5      int64_t size;
     3.6  
     3.7 -    fd = open(filename, O_RDWR | O_BINARY | O_LARGEFILE);
     3.8 +    fd = open(filename, O_RDWR | O_BINARY | O_LARGEFILE | O_SYNC);
     3.9      if (fd < 0) {
    3.10          fd = open(filename, O_RDONLY | O_BINARY | O_LARGEFILE);
    3.11          if (fd < 0)
     4.1 --- a/tools/ioemu/block-qcow.c	Fri Aug 04 10:20:33 2006 +0100
     4.2 +++ b/tools/ioemu/block-qcow.c	Fri Aug 04 10:28:51 2006 +0100
     4.3 @@ -95,7 +95,7 @@ static int qcow_open(BlockDriverState *b
     4.4      int fd, len, i, shift;
     4.5      QCowHeader header;
     4.6      
     4.7 -    fd = open(filename, O_RDWR | O_BINARY | O_LARGEFILE);
     4.8 +    fd = open(filename, O_RDWR | O_BINARY | O_LARGEFILE | O_SYNC);
     4.9      if (fd < 0) {
    4.10          fd = open(filename, O_RDONLY | O_BINARY | O_LARGEFILE);
    4.11          if (fd < 0)
     5.1 --- a/tools/ioemu/block-vmdk.c	Fri Aug 04 10:20:33 2006 +0100
     5.2 +++ b/tools/ioemu/block-vmdk.c	Fri Aug 04 10:28:51 2006 +0100
     5.3 @@ -96,7 +96,7 @@ static int vmdk_open(BlockDriverState *b
     5.4      uint32_t magic;
     5.5      int l1_size;
     5.6  
     5.7 -    fd = open(filename, O_RDWR | O_BINARY | O_LARGEFILE);
     5.8 +    fd = open(filename, O_RDWR | O_BINARY | O_LARGEFILE | O_SYNC);
     5.9      if (fd < 0) {
    5.10          fd = open(filename, O_RDONLY | O_BINARY | O_LARGEFILE);
    5.11          if (fd < 0)
     6.1 --- a/tools/ioemu/block.c	Fri Aug 04 10:20:33 2006 +0100
     6.2 +++ b/tools/ioemu/block.c	Fri Aug 04 10:28:51 2006 +0100
     6.3 @@ -677,7 +677,7 @@ static int raw_open(BlockDriverState *bs
     6.4      int rv;
     6.5  #endif
     6.6  
     6.7 -    fd = open(filename, O_RDWR | O_BINARY | O_LARGEFILE);
     6.8 +    fd = open(filename, O_RDWR | O_BINARY | O_LARGEFILE | O_SYNC);
     6.9      if (fd < 0) {
    6.10          fd = open(filename, O_RDONLY | O_BINARY | O_LARGEFILE);
    6.11          if (fd < 0)