On Sun, May 08, 2016 at 07:27:13PM +0000, Fabien Siron wrote:
> Hi everyone,
>
> The following patch moves all the validations of the start command in
> start_vm() as suggested in the comment.
>
> Index: vmctl.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/vmctl/vmctl.c,v
> retrieving revision 1.13
> diff -u -p -r1.13 vmctl.c
> --- vmctl.c 13 Mar 2016 13:11:47 -0000 1.13
> +++ vmctl.c 8 May 2016 19:23:21 -0000
> @@ -67,6 +67,19 @@ start_vm(const char *name, int memsize,
> struct vm_create_params *vcp;
> int i;
>
> + if (memsize < 1)
> + errx(1, "specified memory size too small");
> + if (kernel == NULL)
> + errx(1, "no kernel specified");
> + if (ndisks > VMM_MAX_DISKS_PER_VM)
> + errx(1, "too many disks");
> + else if (ndisks == 0)
> + warnx("stating without disks");
Has a new typo "stating" should be "starting".
--
Kind regards,
Hiltjo