nixpkgs/nixos
aszlig f148c5c4a1
nixos/tests: Fix QEMU flags for SCSI disks
The ability to specify "-drive if=scsi" has been removed in QEMU version
2.12 (introduced in 3e3b39f173).

Quote from https://wiki.qemu.org/ChangeLog/2.12#Incompatible_changes:

> The deprecated way of configuring SCSI devices with "-drive if=scsi"
> on x86 has been removed. Use an appropriate SCSI controller together
> "-device scsi-hd" or "-device scsi-cd" and a corresponding "-blockdev"
> parameter instead.

So whenever the diskInterface is "scsi" we use the new way to specify
the drive and fall back to the deprecated way for the time being. The
reason why I'm not using the new way for "virtio" and "ide" as well is
because there is no simple generic way anymore to specify these.

This also turns the type of the virtualisation.qemu.diskInterface option
to be an enum, so the user knows which values are allowed but we can
also make sure the right value is provided to prevent typos.

I've tested this against a few non-disk-related NixOS VM tests but also
the installer.grub1 test (because it uses "ide" as its drive interface),
the installer.simple test (just to be sure it still works with
"virtio") and all the tests in nixos/tests/boot.nix.

In order to be able to run the grub1 test I had to go back to
8b1cf100cd (which is a known commit where
that test still works) and apply the QEMU update and this very commit,
because right now the test is broken.

Apart from the tests here in nixpkgs, I also ran another[1] test in
another repository which uses the "scsi" disk interface as well (in
comparison to most of the installer tests, this one actually failed
prior to this commit).

All of them now succeed.

[1]: 9b5a119972/tests/system/kernel/bfq.nix

Signed-off-by: aszlig <aszlig@nix.build>
Cc: @edostra, @grahamc, @dezgeg, @abbradar, @ts468
2018-04-30 03:02:59 +02:00
..
doc/manual rl-1809: add netcat note 2018-04-29 18:30:42 -05:00
lib nixos/tests: Fix QEMU flags for SCSI disks 2018-04-30 03:02:59 +02:00
maintainers Update create-gce.sh script. Set default option for GCE images to disable host key replacement by service. 2018-04-06 10:57:31 +02:00
modules nixos/tests: Fix QEMU flags for SCSI disks 2018-04-30 03:02:59 +02:00
tests nixos/tests/udisks2: Fix USB device hotplug 2018-04-30 03:02:57 +02:00
COPYING
default.nix nixos: export packages of the current configuration (its pkgs argument) 2018-02-09 19:35:27 +00:00
README
release-combined.nix Revert "release-combined: don't include tests.chromium" 2018-04-27 02:42:12 +02:00
release-small.nix Add the boot test to release-small.nix 2018-02-27 20:09:07 +01:00
release.nix Merge pull request #33679 from flokli/deluge-module 2018-04-25 14:54:34 -05:00

*** NixOS ***

NixOS is a Linux distribution based on the purely functional package
management system Nix.  More information can be found at
http://nixos.org/nixos and in the manual in doc/manual.