diff options
author | Riku Voipio <riku.voipio@linaro.org> | 2017-05-11 13:47:23 +0300 |
---|---|---|
committer | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2017-05-12 15:47:09 +0000 |
commit | 2b26706ffe60224ea87b7c9c5fa9561350e32dcb (patch) | |
tree | 4d84c74a52c38422e9999d9f0b1e296deda5cb9c /automated/linux/kvm/wait-kvm.sh | |
parent | daec34dad7e701c5f92c7fb19b73f07ae68c7028 (diff) |
kvm-cloud: de-race shutdown
- move to automated dir
- start qemu with pidfile
- call shutdown with 1m timeout in guest for clean poweroff
- wait for qemu process recorded in pidfile to exit to
avoid primary lava connection to poweroff the machine before
guest has finished
Change-Id: I105ec3bbe3246a05552b3d13123ef4a3c7ea4c82
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Diffstat (limited to 'automated/linux/kvm/wait-kvm.sh')
-rwxr-xr-x | automated/linux/kvm/wait-kvm.sh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/automated/linux/kvm/wait-kvm.sh b/automated/linux/kvm/wait-kvm.sh new file mode 100755 index 00000000..1ba1d07f --- /dev/null +++ b/automated/linux/kvm/wait-kvm.sh @@ -0,0 +1,8 @@ +#!/bin/sh -e + +[ -r "$1" ]||exit 0 + +while [ -d "/proc/$(cat $1)/" ] +do + sleep 10 +done |