From 3fb00aad0e5209d0f1e027cca5faa68fa4da69d5 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 2 Jul 2012 12:47:37 +0100 Subject: Add notes about how qemu cache=none works internally. This is just a comment and has no functional effect. (cherry picked from commit 0437a7905619b8370e25fbae1a3e6388c5277be9) --- src/launch.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/launch.c b/src/launch.c index 61b903d9..466ec89c 100644 --- a/src/launch.c +++ b/src/launch.c @@ -236,7 +236,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. */ -- cgit