diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2017-03-15 12:42:13 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2017-03-15 12:42:13 +0000 |
commit | 216fe96865b86ea0790b4b193eabf0adb2ec0620 (patch) | |
tree | fb9013ac6bcdb012bd9cdafb9411fd71e94dc5d0 /usr.sbin/vmd/control.c | |
parent | 71e1df8f7d0e006b9be8d74be882d1814dceef6d (diff) |
Don't terminate vmd(8) when we lost the control connection.
When a start vm request is received from vmctl via the control socket,
vmd's control process forwards it to the parent to trigger the action.
A response is received later, in an async way, and send back to vmctl
that is supposed to wait for it. But now, if vmctl got terminated
before receiving the response, vmd fails to find the control
connection. In this case it should not abort, print and warning, and
ignore the error. The fix is a simple as changing a return (-1) to a
return (0).
This fixes an issue that was reported by mlarkin@
Diffstat (limited to 'usr.sbin/vmd/control.c')
-rw-r--r-- | usr.sbin/vmd/control.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/vmd/control.c b/usr.sbin/vmd/control.c index ff7ec7f0839..2f3d0d9e74b 100644 --- a/usr.sbin/vmd/control.c +++ b/usr.sbin/vmd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.15 2017/03/01 07:43:33 reyk Exp $ */ +/* $OpenBSD: control.c,v 1.16 2017/03/15 12:42:12 reyk Exp $ */ /* * Copyright (c) 2010-2015 Reyk Floeter <reyk@openbsd.org> @@ -86,9 +86,9 @@ control_dispatch_vmd(int fd, struct privsep_proc *p, struct imsg *imsg) case IMSG_VMDOP_GET_INFO_VM_DATA: case IMSG_VMDOP_GET_INFO_VM_END_DATA: if ((c = control_connbyfd(imsg->hdr.peerid)) == NULL) { - log_warnx("%s: fd %d: not found", + log_warnx("%s: lost control connection: fd %d", __func__, imsg->hdr.peerid); - return (-1); + return (0); } imsg_compose_event(&c->iev, imsg->hdr.type, 0, 0, -1, imsg->data, IMSG_DATA_SIZE(imsg)); |