summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-07-02 12:47:37 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-07-06 17:36:30 +0100
commit7876f604e9b58a73d7394ed373795ad7707293a4 (patch)
tree53e9a4e97ca72f699d065a9080e12b61d47f8573
parent25f20c98bf000a46c424f792e04fd04c7b17bcad (diff)
downloadlibguestfs-7876f604e9b58a73d7394ed373795ad7707293a4.tar.gz
libguestfs-7876f604e9b58a73d7394ed373795ad7707293a4.tar.xz
libguestfs-7876f604e9b58a73d7394ed373795ad7707293a4.zip
Add notes about how qemu cache=none works internally.
This is just a comment and has no functional effect. (cherry picked from commit 0437a7905619b8370e25fbae1a3e6388c5277be9)
-rw-r--r--src/launch.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/launch.c b/src/launch.c
index 66b77d2a..abfd1d05 100644
--- a/src/launch.c
+++ b/src/launch.c
@@ -294,7 +294,18 @@ guestfs__config (guestfs_h *g,
* So we check if we can open the file with or without O_DIRECT,
* and use cache=none (or not) accordingly.
*
- * NB: This function is only called on the !readonly path. We must
+ * Notes:
+ *
+ * (1) In qemu, cache=none and cache=off are identical.
+ *
+ * (2) cache=none does not disable caching entirely. qemu still
+ * maintains a writeback cache internally, which will be written out
+ * when qemu is killed (with SIGTERM). It disables *host kernel*
+ * caching by using O_DIRECT. To disable caching entirely in kernel
+ * and qemu we would need to use cache=directsync but there is a
+ * performance penalty for that.
+ *
+ * (3) This function is only called on the !readonly path. We must
* try to open with O_RDWR to test that the file is readable and
* writable here.
*/