summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2015-12-07 16:02:10 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2015-12-07 16:02:10 +0000
commit1ecf72b8b22c44113854bcbef3730d13e71035c5 (patch)
treeb5e241cef0d7c77a742e797b3d73e8f0769fd2a4 /usr.sbin
parent945a8c85a2097a709b24bc170a0dd6e2d8617a2d (diff)
Forcibly remove the local vm reference on error.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/vmd/vmm.c6
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;