From 92196b2f5664d5defa778b1b24df56e2239b5e93 Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Thu, 4 Aug 2011 12:26:52 +0100 Subject: block: add cache=directsync parameter to -drive This patch adds -drive cache=directsync for O_DIRECT | O_SYNC host file I/O with no disk write cache presented to the guest. This mode is useful when guests may not be sending flushes when appropriate and therefore leave data at risk in case of power failure. When cache=directsync is used, write operations are only completed to the guest when data is safely on disk. This new mode is like cache=writethrough but it bypasses the host page cache. Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- qemu-config.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'qemu-config.c') diff --git a/qemu-config.c b/qemu-config.c index 1eb6b9a709..139e07768b 100644 --- a/qemu-config.c +++ b/qemu-config.c @@ -55,7 +55,8 @@ static QemuOptsList qemu_drive_opts = { },{ .name = "cache", .type = QEMU_OPT_STRING, - .help = "host cache usage (none, writeback, writethrough, unsafe)", + .help = "host cache usage (none, writeback, writethrough, " + "directsync, unsafe)", },{ .name = "aio", .type = QEMU_OPT_STRING, -- cgit v1.2.1