summaryrefslogtreecommitdiff
path: root/qemu-doc.texi
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-10-14 14:42:54 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-10-14 14:42:54 +0000
commit9f7965c7e965c8b80da27048017a360b3c57c4af (patch)
tree9a7b218b7a7b590fe926f1c282dfa0916f19092c /qemu-doc.texi
parenteeb438c1b84468e8faa7e69bec86b78b45f2347f (diff)
downloadqemu-9f7965c7e965c8b80da27048017a360b3c57c4af.tar.gz
qemu-9f7965c7e965c8b80da27048017a360b3c57c4af.tar.bz2
qemu-9f7965c7e965c8b80da27048017a360b3c57c4af.zip
Expand cache= option and use write-through caching by default
This patch changes the cache= option to accept none, writeback, or writethough to control the host page cache behavior. By default, writethrough caching is now used which internally is implemented by using O_DSYNC to open the disk images. When using -snapshot, writeback is used by default since data integrity it not at all an issue. cache=none has the same behavior as cache=off previously. The later syntax is still supported by now deprecated. I also cleaned up the O_DIRECT implementation to avoid many of the #ifdefs. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5485 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'qemu-doc.texi')
-rw-r--r--qemu-doc.texi17
1 files changed, 16 insertions, 1 deletions
diff --git a/qemu-doc.texi b/qemu-doc.texi
index adf270b470..84021fb816 100644
--- a/qemu-doc.texi
+++ b/qemu-doc.texi
@@ -267,13 +267,28 @@ These options have the same definition as they have in @option{-hdachs}.
@item snapshot=@var{snapshot}
@var{snapshot} is "on" or "off" and allows to enable snapshot for given drive (see @option{-snapshot}).
@item cache=@var{cache}
-@var{cache} is "on" or "off" and allows to disable host cache to access data.
+@var{cache} is "none", "writeback", or "writethrough" and controls how the host cache is used to access block data.
@item format=@var{format}
Specify which disk @var{format} will be used rather than detecting
the format. Can be used to specifiy format=raw to avoid interpreting
an untrusted format header.
@end table
+By default, writethrough caching is used for all block device. This means that
+the host page cache will be used to read and write data but write notification
+will be sent to the guest only when the data has been reported as written by
+the storage subsystem.
+
+Writeback caching will report data writes as completed as soon as the data is
+present in the host page cache. This is safe as long as you trust your host.
+If your host crashes or loses power, then the guest may experience data
+corruption. When using the @option{-snapshot} option, writeback caching is
+used by default.
+
+The host page can be avoided entirely with @option{cache=none}. This will
+attempt to do disk IO directly to the guests memory. QEMU may still perform
+an internal copy of the data.
+
Instead of @option{-cdrom} you can use:
@example
qemu -drive file=file,index=2,media=cdrom