diff options
author | mlarkin <mlarkin@openbsd.org> | 2017-08-31 06:23:37 +0000 |
---|---|---|
committer | mlarkin <mlarkin@openbsd.org> | 2017-08-31 06:23:37 +0000 |
commit | 3174964670998524f370b2a532b55f103bda54c0 (patch) | |
tree | 9a0e4dc894636e487a54e729412bfdf1f6df1574 /usr.sbin/vmctl | |
parent | match vmctl.8 vm name constraints (diff) | |
download | wireguard-openbsd-3174964670998524f370b2a532b55f103bda54c0.tar.xz wireguard-openbsd-3174964670998524f370b2a532b55f103bda54c0.zip |
vmd/vmctl: disallow use of block or character devices as disks in VMs.
These don't work today and present the user with a confusing error
message if an attempt is made to use them. This commit detects attempts
to use block or character devices and if detected, presents the user with
a better message.
ok jasper
From Carlos Cardenas, thanks!
Diffstat (limited to 'usr.sbin/vmctl')
-rw-r--r-- | usr.sbin/vmctl/vmctl.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/vmctl/vmctl.c b/usr.sbin/vmctl/vmctl.c index f694f61e48c..c556ee821af 100644 --- a/usr.sbin/vmctl/vmctl.c +++ b/usr.sbin/vmctl/vmctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmctl.c,v 1.40 2017/08/30 05:36:23 mlarkin Exp $ */ +/* $OpenBSD: vmctl.c,v 1.41 2017/08/31 06:23:37 mlarkin Exp $ */ /* * Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org> @@ -204,6 +204,11 @@ vm_start_complete(struct imsg *imsg, int *ret, int autoconnect) warnx("could not find specified disk image(s)"); *ret = ENOENT; break; + case VMD_DISK_INVALID: + warnx("specified disk image(s) are " + "not regular files"); + *ret = ENOENT; + break; default: errno = res; warn("start vm command failed"); |