From aa0e0517c2b868479a05ca9b771ab6cbd53dc99a Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sun, 14 Jun 2020 12:23:02 +0800 Subject: [PATCH] wfvm: wait for VM to terminate instead of killing it --- artiq-fast/wfvm/win.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/artiq-fast/wfvm/win.nix b/artiq-fast/wfvm/win.nix index c6d9b83..031bd68 100644 --- a/artiq-fast/wfvm/win.nix +++ b/artiq-fast/wfvm/win.nix @@ -186,6 +186,7 @@ let # Create an image referencing the previous image in the chain qemu-img create -f qcow2 -b ${acc} c.img + set -m qemu-system-x86_64 ${lib.concatStringsSep " " qemuParams} & # If the machine is not up within 10 minutes it's likely never coming up @@ -212,14 +213,18 @@ let sleep 1 done - echo "Executing user script to build layer" - + echo "Executing user script..." ${script} + echo "Done" # Allow install to "settle" sleep 20 + echo "Shutting down..." win-exec 'shutdown /s' + echo "Waiting for VM to terminate..." + fg + echo "Done" mv c.img $out '')) baseImage installCommands;