summaryrefslogtreecommitdiff
path: root/usr.sbin/vmctl/vmctl.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2018-12-06 09:23:16 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2018-12-06 09:23:16 +0000
commit97bef4c1d0b92215e63006d754555d38107418d3 (patch)
tree5148d75af81a48b7ceb800d0f4684e77a71ae406 /usr.sbin/vmctl/vmctl.c
parent232ccf2186c725c6c77341f3b4bed35c91d322d2 (diff)
Add a new argument -B device to vmctl start. It allows to set the boot device.
At the moment only 'net' is supported and all other values are silently ignored. This allows to kick of an OpenBSD autoinstall by using: vmctl start "installer" -Lc -B net -b bsd.rd -d disk.img OK ccardenas@
Diffstat (limited to 'usr.sbin/vmctl/vmctl.c')
-rw-r--r--usr.sbin/vmctl/vmctl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/vmctl/vmctl.c b/usr.sbin/vmctl/vmctl.c
index 334f43968c8..68e6c1d6a97 100644
--- a/usr.sbin/vmctl/vmctl.c
+++ b/usr.sbin/vmctl/vmctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmctl.c,v 1.64 2018/12/04 08:17:17 claudio Exp $ */
+/* $OpenBSD: vmctl.c,v 1.65 2018/12/06 09:23:15 claudio Exp $ */
/*
* Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
@@ -73,7 +73,7 @@ unsigned int info_flags;
int
vm_start(uint32_t start_id, const char *name, int memsize, int nnics,
char **nics, int ndisks, char **disks, int *disktypes, char *kernel,
- char *iso, char *instance)
+ char *iso, char *instance, unsigned int bootdevice)
{
struct vmop_create_params *vmc;
struct vm_create_params *vcp;
@@ -184,6 +184,7 @@ vm_start(uint32_t start_id, const char *name, int memsize, int nnics,
if (strlcpy(vmc->vmc_instance, instance,
sizeof(vmc->vmc_instance)) >= sizeof(vmc->vmc_instance))
errx(1, "instance vm name too long");
+ vmc->vmc_bootdevice = bootdevice;
imsg_compose(ibuf, IMSG_VMDOP_START_VM_REQUEST, 0, 0, -1,
vmc, sizeof(struct vmop_create_params));