From 796dde5d686dd9ff57b72411f37fcbaff5179d13 Mon Sep 17 00:00:00 2001 From: sthen Date: Wed, 10 Jan 2018 14:59:59 +0000 Subject: [PATCH] Don't require "disk" or "kernel", also allow just "cdrom" instead, a VM can still be useful with only cdrom storage. ok ccardenas@ --- usr.sbin/vmd/vmd.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/usr.sbin/vmd/vmd.c b/usr.sbin/vmd/vmd.c index 450e8f8babd..c0499e03813 100644 --- a/usr.sbin/vmd/vmd.c +++ b/usr.sbin/vmd/vmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmd.c,v 1.78 2018/01/08 11:58:27 mpi Exp $ */ +/* $OpenBSD: vmd.c,v 1.79 2018/01/10 14:59:59 sthen Exp $ */ /* * Copyright (c) 2015 Reyk Floeter @@ -1140,8 +1140,9 @@ vm_register(struct privsep *ps, struct vmop_create_params *vmc, } else if (vcp->vcp_nnics > VMM_MAX_NICS_PER_VM) { log_warnx("invalid number of interfaces"); goto fail; - } else if (strlen(vcp->vcp_kernel) == 0 && vcp->vcp_ndisks == 0) { - log_warnx("no kernel or disk specified"); + } else if (strlen(vcp->vcp_kernel) == 0 && + vcp->vcp_ndisks == 0 && strlen(vcp->vcp_cdrom) == 0) { + log_warnx("no kernel or disk/cdrom specified"); goto fail; } else if (strlen(vcp->vcp_name) == 0) { log_warnx("invalid VM name"); -- 2.20.1