diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2015-12-07 16:02:10 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2015-12-07 16:02:10 +0000 |
commit | 1ecf72b8b22c44113854bcbef3730d13e71035c5 (patch) | |
tree | b5e241cef0d7c77a742e797b3d73e8f0769fd2a4 /usr.sbin | |
parent | 945a8c85a2097a709b24bc170a0dd6e2d8617a2d (diff) |
Forcibly remove the local vm reference on error.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/vmd/vmm.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/vmd/vmm.c b/usr.sbin/vmd/vmm.c index 81b466e71f3..7e4eace4494 100644 --- a/usr.sbin/vmd/vmm.c +++ b/usr.sbin/vmd/vmm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmm.c,v 1.11 2015/12/07 14:43:24 reyk Exp $ */ +/* $OpenBSD: vmm.c,v 1.12 2015/12/07 16:02:09 reyk Exp $ */ /* * Copyright (c) 2015 Mike Larkin <mlarkin@openbsd.org> @@ -234,6 +234,10 @@ vmm_dispatch_parent(int fd, struct privsep_proc *p, struct imsg *imsg) case 0: break; case IMSG_VMDOP_START_VM_RESPONSE: + if (res != 0) { + vm = vm_getbyvmid(imsg->hdr.peerid); + vm_remove(vm); + } case IMSG_VMDOP_TERMINATE_VM_RESPONSE: memset(&vmr, 0, sizeof(vmr)); vmr.vmr_result = res; |