From fd1e2c3940032086025dddcc3a88bd68b60a78e5 Mon Sep 17 00:00:00 2001 From: anton Date: Wed, 14 Aug 2019 07:34:50 +0000 Subject: Improve the error message when supplying an invalid template to vmctl start. Favoring 'invalid template' over 'permission denied' should give the user a better hint on what went wrong. ok kn@ mlarkin@ --- usr.sbin/vmctl/vmctl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'usr.sbin/vmctl') diff --git a/usr.sbin/vmctl/vmctl.c b/usr.sbin/vmctl/vmctl.c index 60b028b7809..b5a2fc420a0 100644 --- a/usr.sbin/vmctl/vmctl.c +++ b/usr.sbin/vmctl/vmctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmctl.c,v 1.69 2019/05/22 16:19:21 jasper Exp $ */ +/* $OpenBSD: vmctl.c,v 1.70 2019/08/14 07:34:49 anton Exp $ */ /* * Copyright (c) 2014 Mike Larkin @@ -249,6 +249,10 @@ vm_start_complete(struct imsg *imsg, int *ret, int autoconnect) "file"); *ret = ENOENT; break; + case VMD_PARENT_INVALID: + warnx("invalid template"); + *ret = EINVAL; + break; default: errno = res; warn("start vm command failed"); -- cgit v1.2.3