summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Rockai <prockai@redhat.com>2014-09-30 11:02:25 +0200
committerPetr Rockai <prockai@redhat.com>2014-11-20 12:36:47 +0100
commitae52119c8b12e2cb3936f787c1d0ad2369d5cfd1 (patch)
treebe363194718cc0be67b1a29db99b87ff00212a7a
parent084b85a061e9fc359d7eb403e408376639b76cba (diff)
downloadlvm2-ae52119c8b12e2cb3936f787c1d0ad2369d5cfd1.tar.gz
NIX: Detect that the VM booted up more directly.
-rw-r--r--nix/default.nix9
1 files changed, 8 insertions, 1 deletions
diff --git a/nix/default.nix b/nix/default.nix
index 734fb3bb3..5999bd2ae 100644
--- a/nix/default.nix
+++ b/nix/default.nix
@@ -45,6 +45,7 @@ let
sha256 = "0ycdh5mb7p5ll76mqk0p6gpnjskvxxgh3a3bfr1crh94nvpwhp4z"; }}
mkdir -p /xchg/results
+ touch /xchg/booted
dmsetup targets
@@ -123,11 +124,17 @@ let
monitor &
for i in `seq 1 20`; do # we allow up to 20 VM restarts
+ rm -f xchg/booted
${vmtools.qemu}/bin/qemu-img create -f qcow2 /dev/shm/testdisk.img 4G
setsid bash -e ${vmtools.vmRunCommand (vmtools.qemuCommandLinux kernel)} &
pid=$!
- sleep 180 # give the VM some time to get up and running
+ # give the VM some time to get up and running
+ slept=0
+ while test $slept -le 180 && test ! -e xchg/booted; do
+ sleep 10
+ slept=$(($slept + 10))
+ done
echo $pid > pid # monitor go
wait $pid || true
rm -f pid # disarm the monitor process