From fc583b70548b5098afd6b71dc78376427fd0a797 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 27 Jan 2010 10:36:43 +0000 Subject: [PATCH] * When QEMU encounters a "disk full" condition on the host filesystem, its default behaviour is to stop the emulator (i.e. suspend the VM). For automated tests, this is bad, because is makes the VM appear to hang without any error message. The "werror=report" flag causes QEMU to report the problem to the VM. As a side effect QEMU exits very elegantly: [ 2.308668] end_request: I/O error, dev vda, sector 534400 [ 2.309611] Buffer I/O error on device vda, logical block 66800 ... *** glibc detected *** /nix/store/yhngqrww53j0aw7z7v4bv948x5g5fc3d-qemu-kvm-0.12.1.2/bin/qemu-system-x86_64: double free or corruption (!prev): 0x08e3e040 *** Aborted So I guess we now depend on a bug in QEMU :-) svn path=/nixos/trunk/; revision=19703 --- lib/test-driver/Machine.pm | 2 +- modules/virtualisation/qemu-vm.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/test-driver/Machine.pm b/lib/test-driver/Machine.pm index 069d60261a1..43463eb7134 100644 --- a/lib/test-driver/Machine.pm +++ b/lib/test-driver/Machine.pm @@ -25,7 +25,7 @@ sub new { $startCommand = "qemu-system-x86_64 -m 384 -no-kvm-irqchip " . "-net nic,model=virtio -net user \$QEMU_OPTS "; - $startCommand .= "-drive file=" . Cwd::abs_path($args->{hda}) . ",if=virtio,boot=on " + $startCommand .= "-drive file=" . Cwd::abs_path($args->{hda}) . ",if=virtio,boot=on,werror=report " if defined $args->{hda}; $startCommand .= "-cdrom $args->{cdrom} " if defined $args->{cdrom}; diff --git a/modules/virtualisation/qemu-vm.nix b/modules/virtualisation/qemu-vm.nix index 09764c09b90..a17e167cb46 100644 --- a/modules/virtualisation/qemu-vm.nix +++ b/modules/virtualisation/qemu-vm.nix @@ -86,7 +86,7 @@ let exec ${pkgs.qemu_kvm}/bin/qemu-system-x86_64 -m ${toString config.virtualisation.memorySize} \ -no-kvm-irqchip \ -net nic,model=virtio -net user -smb / \ - -drive file=$NIX_DISK_IMAGE,if=virtio,boot=on \ + -drive file=$NIX_DISK_IMAGE,if=virtio,boot=on,werror=report \ -kernel ${config.system.build.toplevel}/kernel \ -initrd ${config.system.build.toplevel}/initrd \ ${qemuGraphics} \