summaryrefslogtreecommitdiffstats
path: root/usr.sbin/vmd/control.c
diff options
context:
space:
mode:
authorreyk <reyk@openbsd.org>2018-07-11 09:35:44 +0000
committerreyk <reyk@openbsd.org>2018-07-11 09:35:44 +0000
commitf6e5c9eb7e9081dc2abaae8f39a56d6a510abeb2 (patch)
treef0a21de60c782793f9c7892c63b552b4bfc71bcb /usr.sbin/vmd/control.c
parentin if_addgroup(), call the new pfi_group_addmember() instead of (diff)
downloadwireguard-openbsd-f6e5c9eb7e9081dc2abaae8f39a56d6a510abeb2.tar.xz
wireguard-openbsd-f6e5c9eb7e9081dc2abaae8f39a56d6a510abeb2.zip
Add -f option to vmctl stop to forcefully kill a VM.
This also fixes a bug in vmm_sighdlr where it might have missed forwarding the TERMINATE_EVENT to the vmd parent after a VM child died, leading to an abandoned VM in the vmd parent process. OK ccardenas@ mlarkin@ benno@ kn@
Diffstat (limited to 'usr.sbin/vmd/control.c')
-rw-r--r--usr.sbin/vmd/control.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/vmd/control.c b/usr.sbin/vmd/control.c
index d9d33c37d4a..37cc538ccb3 100644
--- a/usr.sbin/vmd/control.c
+++ b/usr.sbin/vmd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.25 2018/07/10 20:46:50 reyk Exp $ */
+/* $OpenBSD: control.c,v 1.26 2018/07/11 09:35:44 reyk Exp $ */
/*
* Copyright (c) 2010-2015 Reyk Floeter <reyk@openbsd.org>
@@ -352,6 +352,7 @@ control_dispatch_imsg(int fd, short event, void *arg)
switch (imsg.hdr.type) {
case IMSG_VMDOP_GET_INFO_VM_REQUEST:
case IMSG_VMDOP_TERMINATE_VM_REQUEST:
+ case IMSG_VMDOP_KILL_VM_REQUEST:
case IMSG_VMDOP_START_VM_REQUEST:
case IMSG_VMDOP_PAUSE_VM:
case IMSG_VMDOP_UNPAUSE_VM:
@@ -410,6 +411,7 @@ control_dispatch_imsg(int fd, short event, void *arg)
}
break;
case IMSG_VMDOP_TERMINATE_VM_REQUEST:
+ case IMSG_VMDOP_KILL_VM_REQUEST:
if (IMSG_DATA_SIZE(&imsg) < sizeof(vid))
goto fail;
memcpy(&vid, imsg.data, sizeof(vid));