From f10a7bfd4cb57c6325992d86d4bf9161d4bb0072 Mon Sep 17 00:00:00 2001 From: Byoungchan Lee Date: Tue, 26 Dec 2023 18:37:10 +0900 Subject: [PATCH] Add mmap cache option to QEMU mount This is required for mmap'ing on mounted files on MacOS Host. Closes #19639, #20055. Signed-off-by: Byoungchan Lee --- pkg/machine/qemu/machine.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/machine/qemu/machine.go b/pkg/machine/qemu/machine.go index 9a74113a44..eba16f8e96 100644 --- a/pkg/machine/qemu/machine.go +++ b/pkg/machine/qemu/machine.go @@ -347,7 +347,7 @@ func (v *MachineVM) mountVolumesToVM(opts machine.StartOptions, name string) err case MountType9p: mountOptions := []string{"-t", "9p"} mountOptions = append(mountOptions, []string{"-o", "trans=virtio", mount.Tag, mount.Target}...) - mountOptions = append(mountOptions, []string{"-o", "version=9p2000.L,msize=131072"}...) + mountOptions = append(mountOptions, []string{"-o", "version=9p2000.L,msize=131072,cache=mmap"}...) if mount.ReadOnly { mountOptions = append(mountOptions, []string{"-o", "ro"}...) }