nixpkgs/nixos/modules
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
..
config treewide: isArm -> isAarch32 2018-04-25 15:28:55 -04:00
hardware Merge branch 'master' into staging 2018-04-10 09:13:36 +02:00
i18n/input-method Remove top-level kde5 attribute 2017-02-27 11:49:10 -06:00
installer Merge pull request #39617 from Mic92/nixos-generate-config 2018-04-28 00:33:21 +02:00
misc lib/debug: fix use-sites of deprecated debug functions 2018-04-27 18:59:39 +02:00
profiles Merge pull request #38114 from oxij/nixos/doc-module 2018-04-05 07:09:32 +00:00
programs nixos: enable bash command completion by default 2018-04-13 18:36:51 +02:00
security Fix incorrect merge 2018-04-21 22:34:39 +02:00
services Merge pull request #39137 from peterhoeg/m/lcd 2018-04-28 22:57:59 +00:00
system Merge pull request #39340 from xeji/interim-fix-39069 2018-04-29 20:45:09 +02:00
tasks lxd: 2.16 -> 3.0.0 2018-04-14 11:02:24 +01:00
testing nixos/qemu: Deduplicate QEMU serialDevice into qemu-flags.nix 2018-01-30 16:57:27 +02:00
virtualisation nixos/tests: Fix QEMU flags for SCSI disks 2018-04-30 03:02:59 +02:00
module-list.nix Merge pull request #39137 from peterhoeg/m/lcd 2018-04-28 22:57:59 +00:00
rename.nix Merge pull request #39048 from oxij/nixos/fix-rename-bugs 2018-04-22 17:46:09 +00:00