summaryrefslogtreecommitdiff
path: root/usr.sbin/vmd/control.c
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2017-05-04 19:41:59 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2017-05-04 19:41:59 +0000
commit48992d4e20dd562821eb7d367155b48eecd1287f (patch)
treed38b7373a3c4b26fa90f1dda9eb40c17285d6239 /usr.sbin/vmd/control.c
parent7f974b78cee07c7d1db67bc826cf636862318b39 (diff)
Report command failure back to vmctl reload, reset, load, log verbose.
OK mlarkin@
Diffstat (limited to 'usr.sbin/vmd/control.c')
-rw-r--r--usr.sbin/vmd/control.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/usr.sbin/vmd/control.c b/usr.sbin/vmd/control.c
index d67b19001ed..1e7eba2f0b3 100644
--- a/usr.sbin/vmd/control.c
+++ b/usr.sbin/vmd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.18 2017/05/04 16:54:41 reyk Exp $ */
+/* $OpenBSD: control.c,v 1.19 2017/05/04 19:41:58 reyk Exp $ */
/*
* Copyright (c) 2010-2015 Reyk Floeter <reyk@openbsd.org>
@@ -86,6 +86,8 @@ control_dispatch_vmd(int fd, struct privsep_proc *p, struct imsg *imsg)
case IMSG_VMDOP_TERMINATE_VM_RESPONSE:
case IMSG_VMDOP_GET_INFO_VM_DATA:
case IMSG_VMDOP_GET_INFO_VM_END_DATA:
+ case IMSG_CTL_FAIL:
+ case IMSG_CTL_OK:
if ((c = control_connbyfd(imsg->hdr.peerid)) == NULL) {
log_warnx("%s: lost control connection: fd %d",
__func__, imsg->hdr.peerid);
@@ -367,11 +369,10 @@ control_dispatch_imsg(int fd, short event, void *arg)
case IMSG_VMDOP_LOAD:
case IMSG_VMDOP_RELOAD:
case IMSG_CTL_RESET:
- proc_forward_imsg(ps, &imsg, PROC_PARENT, -1);
-
- /* Report success to the control client */
- imsg_compose_event(&c->iev, IMSG_CTL_OK,
- 0, 0, -1, NULL, 0);
+ if (proc_compose_imsg(ps, PROC_PARENT, -1,
+ imsg.hdr.type, fd, -1,
+ imsg.data, IMSG_DATA_SIZE(&imsg)) == -1)
+ goto fail;
break;
case IMSG_VMDOP_START_VM_REQUEST:
if (IMSG_DATA_SIZE(&imsg) < sizeof(vmc))