From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=49440 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oy4fF-0008LP-P5 for qemu-devel@nongnu.org; Tue, 21 Sep 2010 11:21:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oy4f9-0005oR-IX for qemu-devel@nongnu.org; Tue, 21 Sep 2010 11:21:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48556) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oy4f9-0005oG-AW for qemu-devel@nongnu.org; Tue, 21 Sep 2010 11:21:43 -0400 From: Kevin Wolf Date: Tue, 21 Sep 2010 17:21:45 +0200 Message-Id: <1285082522-24407-4-git-send-email-kwolf@redhat.com> In-Reply-To: <1285082522-24407-1-git-send-email-kwolf@redhat.com> References: <1285082522-24407-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 03/20] vvfat: Use cache=unsafe List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Kevin Wolf 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 --- block/vvfat.c | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/block/vvfat.c b/block/vvfat.c index 0772037..53e57bf 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 -- 1.7.2.2