From 21f7b2b3f25ed87b038538ac88cfb84bbaf8c58a Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Wed, 3 Jan 2018 12:25:48 -0600 Subject: [PATCH] vmTools: omit '-drive ...' entirely instead of using /dev/null Fixes #33378. --- pkgs/build-support/vm/default.nix | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix index e31f513c666..64f4a759e1b 100644 --- a/pkgs/build-support/vm/default.nix +++ b/pkgs/build-support/vm/default.nix @@ -208,7 +208,7 @@ rec { -device virtio-rng-pci \ -virtfs local,path=${storeDir},security_model=none,mount_tag=store \ -virtfs local,path=$TMPDIR/xchg,security_model=none,mount_tag=xchg \ - -drive file=$diskImage,if=virtio,cache=unsafe,werror=report \ + ''${diskImage:+-drive file=$diskImage,if=virtio,cache=unsafe,werror=report} \ -kernel ${kernel}/${img} \ -initrd ${initrd}/initrd \ -append "console=ttyS0 panic=1 command=${stage2Init} out=$out mountDisk=$mountDisk loglevel=4" \ @@ -223,8 +223,6 @@ rec { mkdir xchg mv saved-env xchg/ - diskImage=''${diskImage:-/dev/null} - eval "$preVM" if [ "$enableParallelBuilding" = 1 ]; then @@ -240,7 +238,7 @@ rec { # the -K option to preserve the temporary build directory). cat > ./run-vm <