nixos/qemu: don't recreate extra disks
This commit is contained in:
parent
28740462e7
commit
399db54e35
|
@ -62,7 +62,9 @@ let
|
||||||
idx=2
|
idx=2
|
||||||
extraDisks=""
|
extraDisks=""
|
||||||
${flip concatMapStrings cfg.emptyDiskImages (size: ''
|
${flip concatMapStrings cfg.emptyDiskImages (size: ''
|
||||||
${pkgs.qemu_kvm}/bin/qemu-img create -f qcow2 "empty$idx.qcow2" "${toString size}M"
|
if ! test -e "empty$idx.qcow2"; then
|
||||||
|
${pkgs.qemu_kvm}/bin/qemu-img create -f qcow2 "empty$idx.qcow2" "${toString size}M"
|
||||||
|
fi
|
||||||
extraDisks="$extraDisks -drive index=$idx,file=$(pwd)/empty$idx.qcow2,if=${cfg.qemu.diskInterface},werror=report"
|
extraDisks="$extraDisks -drive index=$idx,file=$(pwd)/empty$idx.qcow2,if=${cfg.qemu.diskInterface},werror=report"
|
||||||
idx=$((idx + 1))
|
idx=$((idx + 1))
|
||||||
'')}
|
'')}
|
||||||
|
|
Loading…
Reference in New Issue