mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-11 16:00:50 -07:00
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>
This commit is contained in:
parent
5745e38afe
commit
d3ab98e691
10 changed files with 91 additions and 17 deletions
12
vl.c
12
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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue