aboutsummaryrefslogtreecommitdiff
path: root/block-raw-win32.c
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2007-12-24 14:33:24 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2007-12-24 14:33:24 +0000
commit33f002714be2ed58ed05ae3870d5ea6915df4b47 (patch)
tree6b5f907e0c0b42bc6ca4222f1e14462be5e30c1a /block-raw-win32.c
parent3e98dc8ec6af89c7f4f1e006b979eb405b431629 (diff)
downloadqemu-33f002714be2ed58ed05ae3870d5ea6915df4b47.zip
qemu-33f002714be2ed58ed05ae3870d5ea6915df4b47.tar.gz
qemu-33f002714be2ed58ed05ae3870d5ea6915df4b47.tar.bz2
Add "cache" parameter to "-drive" (Laurent Vivier).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3848 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'block-raw-win32.c')
-rw-r--r--block-raw-win32.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/block-raw-win32.c b/block-raw-win32.c
index db9995c..43d3f6c 100644
--- a/block-raw-win32.c
+++ b/block-raw-win32.c
@@ -105,6 +105,8 @@ static int raw_open(BlockDriverState *bs, const char *filename, int flags)
#else
overlapped = FILE_FLAG_OVERLAPPED;
#endif
+ if (flags & BDRV_O_DIRECT)
+ overlapped |= FILE_FLAG_NO_BUFFERING | FILE_FLAG_WRITE_THROUGH;
s->hfile = CreateFile(filename, access_flags,
FILE_SHARE_READ, NULL,
create_flags, overlapped, NULL);
@@ -473,6 +475,8 @@ static int hdev_open(BlockDriverState *bs, const char *filename, int flags)
#else
overlapped = FILE_FLAG_OVERLAPPED;
#endif
+ if (flags & BDRV_O_DIRECT)
+ overlapped |= FILE_FLAG_NO_BUFFERING | FILE_FLAG_WRITE_THROUGH;
s->hfile = CreateFile(filename, access_flags,
FILE_SHARE_READ, NULL,
create_flags, overlapped, NULL);