From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39917) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzTOt-0005Ca-T4 for qemu-devel@nongnu.org; Thu, 09 Aug 2012 10:07:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SzTOo-0004as-1V for qemu-devel@nongnu.org; Thu, 09 Aug 2012 10:07:47 -0400 Received: from mail-yw0-f45.google.com ([209.85.213.45]:36418) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzTOn-0004an-TK for qemu-devel@nongnu.org; Thu, 09 Aug 2012 10:07:41 -0400 Received: by yhpp34 with SMTP id p34so442629yhp.4 for ; Thu, 09 Aug 2012 07:07:41 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Thu, 9 Aug 2012 16:07:21 +0200 Message-Id: <1344521241-22897-4-git-send-email-pbonzini@redhat.com> In-Reply-To: <1344521241-22897-1-git-send-email-pbonzini@redhat.com> References: <1344521241-22897-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 3/3] blockdev: flip default cache mode from writethrough to writeback List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com 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 --- blockdev.c | 1 + 1 file modificato, 1 inserzione(+) 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.11.2