The bhyve monitor currently handles signal exits only when they
produce a core dump or are caused by SIGTERM. Since SIGKILL never
produces a core dump, a bhyve process killed with SIGKILL remains
reported as running.

Treat every signal exit except SIGTERM as a crash so that the domain
is stopped and its resources are cleaned up properly.

Signed-off-by: Roman Bogorodskiy <[email protected]>
---
 src/bhyve/bhyve_monitor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bhyve/bhyve_monitor.c b/src/bhyve/bhyve_monitor.c
index 8e481b17aa..8740c856a8 100644
--- a/src/bhyve/bhyve_monitor.c
+++ b/src/bhyve/bhyve_monitor.c
@@ -161,7 +161,7 @@ bhyveMonitorIO(int watch, int kq, int events G_GNUC_UNUSED, 
void *opaque)
     shutdownBySignal = WIFSIGNALED(status) &&
         WTERMSIG(status) == SIGTERM;
 
-    if (WIFSIGNALED(status) && WCOREDUMP(status)) {
+    if (WIFSIGNALED(status) && !shutdownBySignal) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Guest %1$s got signal %2$d and crashed"),
                        name, WTERMSIG(status));
-- 
2.56.0

Reply via email to