From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzsNG-0006e4-7Y for qemu-devel@nongnu.org; Fri, 10 Aug 2012 12:47:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SzsND-000851-Ot for qemu-devel@nongnu.org; Fri, 10 Aug 2012 12:47:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20412) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzsND-00084v-Ge for qemu-devel@nongnu.org; Fri, 10 Aug 2012 12:47:43 -0400 From: Kevin Wolf Date: Fri, 10 Aug 2012 18:47:25 +0200 Message-Id: <1344617249-6620-8-git-send-email-kwolf@redhat.com> In-Reply-To: <1344617249-6620-1-git-send-email-kwolf@redhat.com> References: <1344617249-6620-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 07/11] blockdev: flip default cache mode from writethrough to writeback List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Paolo Bonzini Now all major device models (IDE, SCSI, virtio) can choose between writethrough and writeback at run-time, and virtio will even revert to writethrough if the guest is not capable of sending flushes. So we can change the default to writeback at last. Tested, for lack of a better idea, with a breakpoint on bdrv_open and all cache choices one by one. Signed-off-by: Paolo Bonzini Signed-off-by: Kevin Wolf --- blockdev.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/blockdev.c b/blockdev.c index 8669142..7c83baa 100644 --- a/blockdev.c +++ b/blockdev.c @@ -377,6 +377,7 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi) } } + bdrv_flags |= BDRV_O_CACHE_WB; if ((buf = qemu_opt_get(opts, "cache")) != NULL) { if (bdrv_parse_cache_flags(buf, &bdrv_flags) != 0) { error_report("invalid cache option"); -- 1.7.6.5