On Thu, Dec 06, 2018 at 10:33:24AM +0100, Claudio Jeker wrote:
> So doing autoinstall with -B net is great but one thing I was missing is
> changing the reboot behaviour of vmd to exit at a guest reboot.
> I came up with this minimal diff that does the trick for me. Now maybe it
> would be better to have a proper flag for this instead of overloading 
> vmc_bootdevice with it.
> 
> What is the preferred way of doing this?
> -- 
> :wq Claudio
> 
> Index: vmd.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/vmd/vmd.c,v
> retrieving revision 1.107
> diff -u -p -r1.107 vmd.c
> --- vmd.c     4 Dec 2018 08:15:09 -0000       1.107
> +++ vmd.c     4 Dec 2018 09:11:51 -0000
> @@ -452,7 +452,8 @@ vmd_dispatch_vmm(int fd, struct privsep_
>                           __func__, vmr.vmr_id);
>                       break;
>               }
> -             if (vmr.vmr_result != EAGAIN) {
> +             if (vmr.vmr_result != EAGAIN ||
> +                 vm->vm_params.vmc_bootdevice) {
>                       if (vm->vm_from_config)
>                               vm_stop(vm, 0, __func__);
>                       else
> 

Here an update for vmctl.8 since this got committed.

-- 
:wq Claudio

Index: vmctl.8
===================================================================
RCS file: /cvs/src/usr.sbin/vmctl/vmctl.8,v
retrieving revision 1.57
diff -u -p -r1.57 vmctl.8
--- vmctl.8     7 Dec 2018 21:59:57 -0000       1.57
+++ vmctl.8     9 Dec 2018 12:23:44 -0000
@@ -168,6 +168,7 @@ to perform a PXE boot using the first ne
 Currently only supported when starting the VM with
 .Fl b
 specifying a kernel image.
+Additionally the VM will stop on guest reboot.
 .It Fl c
 Automatically connect to the VM console.
 .It Fl d Ar disk

Reply via email to