From 33f002714be2ed58ed05ae3870d5ea6915df4b47 Mon Sep 17 00:00:00 2001 From: balrog Date: Mon, 24 Dec 2007 14:33:24 +0000 Subject: Add "cache" parameter to "-drive" (Laurent Vivier). git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3848 c046a42c-6fe2-441c-8c8c-71466251a162 --- block-raw-win32.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'block-raw-win32.c') diff --git a/block-raw-win32.c b/block-raw-win32.c index db9995c046..43d3f6c4c2 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); -- cgit v1.2.3