Remove terminate_vm/vm_remove logic from vmm_dispatch_parent. This logic is present in vmm_sighdlr when a VM process has signaled SIGCHLD for proper cleanup.
diff --git usr.sbin/vmd/vmm.c usr.sbin/vmd/vmm.c index ccd7680b479..8cc1c15157a 100644 --- usr.sbin/vmd/vmm.c +++ usr.sbin/vmd/vmm.c @@ -170,15 +170,13 @@ vmm_dispatch_parent(int fd, struct privsep_proc *p, struct imsg *imsg) else res = 0; } else { - /* in the process of shutting down... */ - log_debug("%s: performing a forced shutdown", - __func__); + /* + * VM is currently being shutdown. + * Check to see if the VM process is still + * active. If not, return VMD_VM_STOP_INVALID. + */ vtp.vtp_vm_id = vm_vmid2id(vm->vm_vmid, vm); - /* ensure vm_id isn't 0 */ - if (vtp.vtp_vm_id != 0) { - res = terminate_vm(&vtp); - vm_remove(vm); - } else { + if (vtp.vtp_vm_id == 0) { log_debug("%s: no vm running anymore", __func__); res = VMD_VM_STOP_INVALID; -- 2.14.2