summary refs log tree commit diff
path: root/nixos/modules/virtualisation
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2015-12-14 17:36:22 +0100
committeraszlig <aszlig@redmoonstudios.org>2015-12-14 17:36:22 +0100
commit6353f580f90c0fdd2b418fa853a78ec508bda2a5 (patch)
tree5b642c51264c6452d49af1926ab492a6adb9f2a3 /nixos/modules/virtualisation
parenta5bc11f9eb70482daf559019f9b775c285defb63 (diff)
downloadnixlib-6353f580f90c0fdd2b418fa853a78ec508bda2a5.tar
nixlib-6353f580f90c0fdd2b418fa853a78ec508bda2a5.tar.gz
nixlib-6353f580f90c0fdd2b418fa853a78ec508bda2a5.tar.bz2
nixlib-6353f580f90c0fdd2b418fa853a78ec508bda2a5.tar.lz
nixlib-6353f580f90c0fdd2b418fa853a78ec508bda2a5.tar.xz
nixlib-6353f580f90c0fdd2b418fa853a78ec508bda2a5.tar.zst
nixlib-6353f580f90c0fdd2b418fa853a78ec508bda2a5.zip
nixos/qemu-vm: Disable cache for $NIX_DISK_IMAGE
As @domenkozar noted in #10828, cache=writeback seems to do more harm
than good:

https://github.com/NixOS/nixpkgs/issues/10828#issuecomment-164426821

He has tested it using the openstack NixOS tests and found that
cache=none significantly improves startup performance.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'nixos/modules/virtualisation')
-rw-r--r--nixos/modules/virtualisation/qemu-vm.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix
index 0cefd618075c..e90e319a36ba 100644
--- a/nixos/modules/virtualisation/qemu-vm.nix
+++ b/nixos/modules/virtualisation/qemu-vm.nix
@@ -76,14 +76,14 @@ let
           -virtfs local,path=$TMPDIR/xchg,security_model=none,mount_tag=xchg \
           -virtfs local,path=''${SHARED_DIR:-$TMPDIR/xchg},security_model=none,mount_tag=shared \
           ${if cfg.useBootLoader then ''
-            -drive index=0,id=drive1,file=$NIX_DISK_IMAGE,if=${cfg.qemu.diskInterface},cache=writeback,werror=report \
+            -drive index=0,id=drive1,file=$NIX_DISK_IMAGE,if=${cfg.qemu.diskInterface},cache=none,werror=report \
             -drive index=1,id=drive2,file=$TMPDIR/disk.img,media=disk \
             ${if cfg.useEFIBoot then ''
               -pflash $TMPDIR/bios.bin \
             '' else ''
             ''}
           '' else ''
-            -drive index=0,id=drive1,file=$NIX_DISK_IMAGE,if=${cfg.qemu.diskInterface},cache=writeback,werror=report \
+            -drive index=0,id=drive1,file=$NIX_DISK_IMAGE,if=${cfg.qemu.diskInterface},cache=none,werror=report \
             -kernel ${config.system.build.toplevel}/kernel \
             -initrd ${config.system.build.toplevel}/initrd \
             -append "$(cat ${config.system.build.toplevel}/kernel-params) init=${config.system.build.toplevel}/init regInfo=${regInfo} ${kernelConsole} $QEMU_KERNEL_PARAMS" \