Currently, eventThread cleanup is missing. Fix that by calling virBhyveDomainObjStopWorker() in virBhyveProcessStop() and un-referring the eventThread in bhyveDomainObjPrivateFree(). Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com> --- I think it would be nice to get this in before 12.6.0. src/bhyve/bhyve_domain.c | 5 +++++ src/bhyve/bhyve_process.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/bhyve/bhyve_domain.c b/src/bhyve/bhyve_domain.c index d5bb22501c..b6344185b7 100644 --- a/src/bhyve/bhyve_domain.c +++ b/src/bhyve/bhyve_domain.c @@ -54,6 +54,11 @@ bhyveDomainObjPrivateFree(void *data) virDomainPCIAddressSetFree(priv->pciaddrs); + if (priv->eventThread) { + VIR_ERROR(_("Unexpected event thread still active during domain deletion")); + g_object_unref(priv->eventThread); + } + g_free(priv); } diff --git a/src/bhyve/bhyve_process.c b/src/bhyve/bhyve_process.c index 636d74afcc..81f00954c2 100644 --- a/src/bhyve/bhyve_process.c +++ b/src/bhyve/bhyve_process.c @@ -675,6 +675,8 @@ virBhyveProcessStop(struct _bhyveConn *driver, if ((priv != NULL) && (priv->mon != NULL)) g_clear_pointer(&priv->mon, bhyveMonitorClose); + virBhyveDomainObjStopWorker(vm); + cmd = virBhyveProcessBuildDestroyCmd(driver, vm->def); if (virCommandRun(cmd, NULL) < 0) { /* Only failure of the actual destroy command warrants unsuccessful return code, -- 2.52.0