diff options
author | 2010-09-10 12:27:04 +0200 | |
---|---|---|
committer | 2010-09-13 14:35:06 +0200 | |
commit | a3c4a01fb25a93d2b76d1fde1958ee616c152c5b (patch) | |
tree | 5ee70ecf5bfd7632ae70cd9c1e45ca67cc8c7060 | |
parent | vvfat: Fix double free for opening the image rw (diff) | |
download | qemu-kvm-a3c4a01fb25a93d2b76d1fde1958ee616c152c5b.tar.gz qemu-kvm-a3c4a01fb25a93d2b76d1fde1958ee616c152c5b.tar.bz2 qemu-kvm-a3c4a01fb25a93d2b76d1fde1958ee616c152c5b.zip |
vvfat: Use cache=unsafe
The qcow file used for write support in vvfat is a temporary file,
so we can use cache=unsafe there. Without this, write support is just
too slow to be of any use.
Signed-off-by: Kevin Wolf <mail@kevin-wolf.de>
(cherry picked from commit 35ccd8aed64727dbefa1b274a8000b46318bfea1)
-rw-r--r-- | block/vvfat.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/block/vvfat.c b/block/vvfat.c index 07720371c..53e57bf22 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -2788,6 +2788,7 @@ static int enable_write_target(BDRVVVFATState *s) { BlockDriver *bdrv_qcow; QEMUOptionParameter *options; + int ret; int size = sector2cluster(s, s->sector_count); s->used_clusters = calloc(size, 1); @@ -2803,11 +2804,16 @@ static int enable_write_target(BDRVVVFATState *s) if (bdrv_create(bdrv_qcow, s->qcow_filename, options) < 0) return -1; + s->qcow = bdrv_new(""); - if (s->qcow == NULL || - bdrv_open(s->qcow, s->qcow_filename, BDRV_O_RDWR, bdrv_qcow) < 0) - { - return -1; + if (s->qcow == NULL) { + return -1; + } + + ret = bdrv_open(s->qcow, s->qcow_filename, + BDRV_O_RDWR | BDRV_O_CACHE_WB | BDRV_O_NO_FLUSH, bdrv_qcow); + if (ret < 0) { + return ret; } #ifndef _WIN32 |