summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-08-09 16:07:21 +0200
committerKevin Wolf <kwolf@redhat.com>2012-08-10 10:25:12 +0200
commit1f212b9d3edd8679bafd3bcf0301795206438724 (patch)
tree1a15edf9d7477d98862a3f68f3247ce60ba05e26
parent9315cbfd8d7074eca44fbc5f93902e97b27d5240 (diff)
downloadhqemu-1f212b9d3edd8679bafd3bcf0301795206438724.zip
hqemu-1f212b9d3edd8679bafd3bcf0301795206438724.tar.gz
blockdev: flip default cache mode from writethrough to writeback
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 <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r--blockdev.c1
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");
OpenPOWER on IntegriCloud