From 13878cb78dc0632043eb89c5ba3193160caaf311 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 4 Jan 2010 09:51:57 +0000 Subject: [PATCH] * Panic on out-of-memory. svn path=/nixos/trunk/; revision=19200 --- modules/testing/test-instrumentation.nix | 8 ++++++++ modules/virtualisation/qemu-vm.nix | 7 +++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/modules/testing/test-instrumentation.nix b/modules/testing/test-instrumentation.nix index a573d2b9f909..75133b72a22d 100644 --- a/modules/testing/test-instrumentation.nix +++ b/modules/testing/test-instrumentation.nix @@ -24,6 +24,14 @@ with pkgs.lib; boot.postBootCommands = '' + # Panic on out-of-memory conditions rather than letting the + # OOM killer randomly get rid of processes, since this leads + # to failures that are hard to diagnose. + echo 2 > /proc/sys/vm/panic_on_oom + + # Coverage data is written into /tmp/coverage-data. Symlink + # it to the host filesystem so that we don't need to copy it + # on shutdown. ( eval $(cat /proc/cmdline) mkdir /hostfs/$hostTmpDir/coverage-data ln -s /hostfs/$hostTmpDir/coverage-data /tmp/coverage-data diff --git a/modules/virtualisation/qemu-vm.nix b/modules/virtualisation/qemu-vm.nix index 1952c15638bf..3455d8f9244e 100644 --- a/modules/virtualisation/qemu-vm.nix +++ b/modules/virtualisation/qemu-vm.nix @@ -16,6 +16,7 @@ let vmName = config.networking.hostName; options = { + virtualisation.memorySize = mkOption { default = 384; @@ -24,6 +25,7 @@ let Memory size (M) of virtual machine. ''; }; + virtualisation.diskImage = mkOption { default = "./${vmName}.qcow2"; @@ -34,6 +36,7 @@ let exist. ''; }; + virtualisation.graphics = mkOption { default = true; @@ -48,8 +51,8 @@ let cfg = config.virtualisation; - qemuGraphics = if (cfg.graphics) then "" else "-nographic"; - kernelConsole = if (cfg.graphics) then "" else "console=ttyS0"; + qemuGraphics = if cfg.graphics then "" else "-nographic"; + kernelConsole = if cfg.graphics then "" else "console=ttyS0"; ttys = [ "tty1" "tty2" "tty3" "tty4" "tty5" "tty6" ]; # Shell script to start the VM.