nixpkgs-suyu/nixos/modules/virtualisation
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
..
amazon-image.nix
amazon-init.nix nixos: Move uses of stdenv.shell to runtimeShell. 2018-03-01 14:38:53 -05:00
amazon-options.nix
azure-agent-entropy.patch
azure-agent.nix azure-agent: add bash to service path. 2018-04-17 16:26:04 +02:00
azure-bootstrap-blobs.nix
azure-common.nix
azure-config-user.nix
azure-config.nix
azure-image.nix
azure-images.nix
azure-qemu-220-no-etc-install.patch
brightbox-config.nix
brightbox-image.nix nixos: rename config.system.nixos* -> config.system.nixos.* 2018-02-18 12:56:30 +00:00
container-config.nix
containers.nix Merge pull request #35541 from xeji/containers-extraflags 2018-04-21 14:16:49 +01:00
docker-image.nix
docker.nix
ec2-amis.nix ec2-amis.nix: add 18.03 images 2018-04-05 11:58:53 +02:00
ec2-data.nix
ecs-agent.nix
gce-images.nix
google-compute-config.nix
google-compute-image.nix google-compute-image: provide correct MTU 2018-04-08 08:46:42 +02:00
grow-partition.nix
hyperv-guest.nix
libvirtd.nix libvirt: 3.10.0 -> 4.1.0 2018-03-08 23:45:28 +00:00
lxc-container.nix
lxc.nix lxd: 2.16 -> 3.0.0 2018-04-14 11:02:24 +01:00
lxcfs.nix
lxd.nix lxd: 2.16 -> 3.0.0 2018-04-14 11:02:24 +01:00
nova-config.nix
openvswitch.nix nixos: Move uses of stdenv.shell to runtimeShell. 2018-03-01 14:38:53 -05:00
parallels-guest.nix parallels: add package config option 2018-03-01 17:09:13 -06:00
qemu-vm.nix nixos/tests: Fix QEMU flags for SCSI disks 2018-04-30 03:02:59 +02:00
rkt.nix
virtualbox-guest.nix
virtualbox-host.nix Virtualbox: Fix type error in networking.interfaces.vboxnet0.ipv4.addresses 2018-02-19 17:48:15 +01:00
virtualbox-image.nix nixos: rename config.system.nixos* -> config.system.nixos.* 2018-02-18 12:56:30 +00:00
vmware-guest.nix
xe-guest-utilities.nix
xen-dom0.nix xen 4.10: link /etc/xen/oxenstored.conf 2018-03-07 22:39:19 +01:00
xen-domU.nix