From d85dc4f6902819be8277d1d65414e51bfbef0ac6 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Wed, 27 May 2020 22:07:43 +0200 Subject: qemu-vm: fix inconsistent caching of xchg dirs xchg is advertised as a bidirectional exchange dir, but file content transfer from host to VM fails due to caching: If a file is read in the VM and then modified on the host, subsequent re-reads in the VM can yield old, cached data. This is caused by the use of 9p's cache=loose mode that is explicitly meant for read-only mounts. 9p doesn't provide any suitable cache modes, so fix this by disabling caching. Also, remove a now unnecessary sync in the test driver. --- pkgs/build-support/vm/default.nix | 2 +- pkgs/build-support/vm/windows/controller/default.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'pkgs/build-support') diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix index 488c7f2ce2c7..cdd713be180d 100644 --- a/pkgs/build-support/vm/default.nix +++ b/pkgs/build-support/vm/default.nix @@ -115,7 +115,7 @@ rec { echo "mounting host's temporary directory..." mkdir -p /fs/tmp/xchg - mount -t 9p xchg /fs/tmp/xchg -o trans=virtio,version=9p2000.L,cache=loose + mount -t 9p xchg /fs/tmp/xchg -o trans=virtio,version=9p2000.L mkdir -p /fs/proc mount -t proc none /fs/proc diff --git a/pkgs/build-support/vm/windows/controller/default.nix b/pkgs/build-support/vm/windows/controller/default.nix index 08b93aaf1174..9d13983a2833 100644 --- a/pkgs/build-support/vm/windows/controller/default.nix +++ b/pkgs/build-support/vm/windows/controller/default.nix @@ -53,7 +53,7 @@ let store /fs/nix/store mount -t 9p \ - -o trans=virtio,version=9p2000.L,cache=loose \ + -o trans=virtio,version=9p2000.L \ xchg /fs/xchg echo root:x:0:0::/root:/bin/false > /fs/etc/passwd -- cgit 1.4.1