diff options
author | Dave Voutila <dv@cvs.openbsd.org> | 2023-04-25 12:46:14 +0000 |
---|---|---|
committer | Dave Voutila <dv@cvs.openbsd.org> | 2023-04-25 12:46:14 +0000 |
commit | dfaf58e2837030abaf552d5534faad6f4399ce1c (patch) | |
tree | a6480222f6fe7514e9d0b38db0b7fb14fbf3b4b5 /usr.sbin/vmctl | |
parent | eba21f3d8d841dbd7d6a710260d947da9c161550 (diff) |
vmm(4)/vmd(8): pull struct members out of vmm ioctl create struct.
The object sent to vmm(4) contained file paths and details the
kernel does not need for cpu virtualization as device emulation is
in userland. Effectively, "pull up" the struct members from the
vm_create_params struct to the parent vmop_create_params struct.
This allows us to clean up some of vmd(8) and simplify things for
switching to having vmctl(8) open the "kernel" file (SeaBIOS, bsd.rd,
etc.) to allow users to boot recovery ramdisk kernels.
ok mlarkin@
Diffstat (limited to 'usr.sbin/vmctl')
-rw-r--r-- | usr.sbin/vmctl/vmctl.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/usr.sbin/vmctl/vmctl.c b/usr.sbin/vmctl/vmctl.c index 9567bac93ed..ae2ecd29a9f 100644 --- a/usr.sbin/vmctl/vmctl.c +++ b/usr.sbin/vmctl/vmctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmctl.c,v 1.84 2023/01/28 14:40:53 dv Exp $ */ +/* $OpenBSD: vmctl.c,v 1.85 2023/04/25 12:46:13 dv Exp $ */ /* * Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org> @@ -128,14 +128,15 @@ vm_start(uint32_t start_id, const char *name, size_t memsize, int nnics, vcp->vcp_memranges[0].vmr_size = memsize; vcp->vcp_ncpus = 1; - vcp->vcp_ndisks = ndisks; - vcp->vcp_nnics = nnics; vcp->vcp_id = start_id; + vmc->vmc_ndisks = ndisks; + vmc->vmc_nnics = nnics; + for (i = 0 ; i < ndisks; i++) { - if (strlcpy(vcp->vcp_disks[i], disks[i], - sizeof(vcp->vcp_disks[i])) >= - sizeof(vcp->vcp_disks[i])) + if (strlcpy(vmc->vmc_disks[i], disks[i], + sizeof(vmc->vmc_disks[i])) >= + sizeof(vmc->vmc_disks[i])) errx(1, "disk path too long"); vmc->vmc_disktypes[i] = disktypes[i]; } @@ -175,12 +176,12 @@ vm_start(uint32_t start_id, const char *name, size_t memsize, int nnics, errx(1, "vm name too long"); } if (kernel != NULL) - if (strlcpy(vcp->vcp_kernel, kernel, - sizeof(vcp->vcp_kernel)) >= sizeof(vcp->vcp_kernel)) + if (strlcpy(vmc->vmc_kernel, kernel, + sizeof(vmc->vmc_kernel)) >= sizeof(vmc->vmc_kernel)) errx(1, "kernel name too long"); if (iso != NULL) - if (strlcpy(vcp->vcp_cdrom, iso, - sizeof(vcp->vcp_cdrom)) >= sizeof(vcp->vcp_cdrom)) + if (strlcpy(vmc->vmc_cdrom, iso, + sizeof(vmc->vmc_cdrom)) >= sizeof(vmc->vmc_cdrom)) errx(1, "cdrom name too long"); if (instance != NULL) if (strlcpy(vmc->vmc_instance, instance, |