aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2011-10-12 19:11:23 +0530
committerAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2011-10-12 19:11:23 +0530
commitd3ab98e6919e9491f8ed7ffe37af73d35a55e1ca (patch)
tree0e805d6c9a58229dbc51f92b3ff3ee9d430e1c02 /vl.c
parent5745e38afeaa15153c2209674fe37e1cbdd65707 (diff)
downloadqemu-d3ab98e6919e9491f8ed7ffe37af73d35a55e1ca.zip
qemu-d3ab98e6919e9491f8ed7ffe37af73d35a55e1ca.tar.gz
qemu-d3ab98e6919e9491f8ed7ffe37af73d35a55e1ca.tar.bz2
hw/9pfs: Add new virtfs option writeout=immediate skip host page cache
writeout=immediate implies the after pwritev we do a sync_file_range. Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/vl.c b/vl.c
index dbf7778..b3c27f6 100644
--- a/vl.c
+++ b/vl.c
@@ -2785,6 +2785,7 @@ int main(int argc, char **argv, char **envp)
case QEMU_OPTION_virtfs: {
QemuOpts *fsdev;
QemuOpts *device;
+ const char *writeout;
olist = qemu_find_opts("virtfs");
if (!olist) {
@@ -2814,6 +2815,17 @@ int main(int argc, char **argv, char **envp)
qemu_opt_get(opts, "mount_tag"));
exit(1);
}
+
+ writeout = qemu_opt_get(opts, "writeout");
+ if (writeout) {
+#ifdef CONFIG_SYNC_FILE_RANGE
+ qemu_opt_set(fsdev, "writeout", writeout);
+#else
+ fprintf(stderr, "writeout=immediate not supported on "
+ "this platform\n");
+ exit(1);
+#endif
+ }
qemu_opt_set(fsdev, "fstype", qemu_opt_get(opts, "fstype"));
qemu_opt_set(fsdev, "path", qemu_opt_get(opts, "path"));
qemu_opt_set(fsdev, "security_model",