From 8db3bdc4fc1d48f3ea441ef2e1a2639d586e1bf0 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 10 Jan 2011 14:22:38 +0000 Subject: [PATCH] * In VM tests, use acpi_pm as the clock source. This causes the guest clock to slow down under high host load. This is usually a bad thing, but for VM tests it should provide a bit more determinism (e.g. if the VM runs at lower speed, then timeouts in the VM should also be delayed). svn path=/nixos/trunk/; revision=25490 --- modules/testing/test-instrumentation.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/testing/test-instrumentation.nix b/modules/testing/test-instrumentation.nix index 0373ad0cf935..6c8f6cfa7978 100644 --- a/modules/testing/test-instrumentation.nix +++ b/modules/testing/test-instrumentation.nix @@ -41,6 +41,16 @@ in respawn = false; }; + boot.initrd.postDeviceCommands = + '' + # Using acpi_pm as a clock source causes the guest clock to + # slow down under high host load. This is usually a bad + # thing, but for VM tests it should provide a bit more + # determinism (e.g. if the VM runs at lower speed, then + # timeouts in the VM should also be delayed). + echo acpi_pm > /sys/devices/system/clocksource/clocksource0/current_clocksource + ''; + boot.postBootCommands = '' # Panic on out-of-memory conditions rather than letting the