From f5786aed54ddf2af4464e5fd20276a9cae4fd6f9 Mon Sep 17 00:00:00 2001 From: reyk <> Date: Wed, 11 Jul 2018 13:19:47 +0000 Subject: [PATCH] Add -w option to vmctl stop to wait for completion of VM termination. Use it in /etc/rc.d/vmd accordingly. OK sthen@ --- src/etc/rc.d/vmd | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/etc/rc.d/vmd b/src/etc/rc.d/vmd index f023ff34..5db92807 100644 --- a/src/etc/rc.d/vmd +++ b/src/etc/rc.d/vmd @@ -1,6 +1,6 @@ #!/bin/ksh # -# $OpenBSD: vmd,v 1.7 2018/02/20 10:12:14 sthen Exp $ +# $OpenBSD: vmd,v 1.8 2018/07/11 13:19:47 reyk Exp $ daemon="/usr/sbin/vmd" @@ -17,10 +17,7 @@ list_running() { rc_stop() { for vm in $(list_running); do - _rc_do vmctl stop "$vm" - while list_running | fgrep -wq "$vm"; do - sleep .1 - done + _rc_do vmctl stop "$vm" -w done pkill -T "${daemon_rtable}" -xf "${pexp}"