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-posix.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'block-raw-posix.c') diff --git a/block-raw-posix.c b/block-raw-posix.c index 089a1f4a99..8ace5ef746 100644 --- a/block-raw-posix.c +++ b/block-raw-posix.c @@ -106,6 +106,10 @@ static int raw_open(BlockDriverState *bs, const char *filename, int flags) } if (flags & BDRV_O_CREAT) open_flags |= O_CREAT | O_TRUNC; +#ifdef O_DIRECT + if (flags & BDRV_O_DIRECT) + open_flags |= O_DIRECT; +#endif s->type = FTYPE_FILE; @@ -659,6 +663,10 @@ static int hdev_open(BlockDriverState *bs, const char *filename, int flags) open_flags |= O_RDONLY; bs->read_only = 1; } +#ifdef O_DIRECT + if (flags & BDRV_O_DIRECT) + open_flags |= O_DIRECT; +#endif s->type = FTYPE_FILE; #if defined(__linux__) -- cgit v1.2.3