On Sun, Dec 09, 2018 at 01:54:50PM +0100, Reyk Floeter wrote: > Sure, the bootdevice trick makes sense. Another trick could probably be to > try to switch to the hard disk after first boot (install) but this would make > the logic and config a bit ugly. > > OK for the diff below. > > The only thing that I’m a bit concerned about is that -B might turn a > bit into a qemu-like getopt madness, especially if it would gain boot > order or something like this. Please don’t complicate it further. But it > still looks fine.
I called it bootdevice for a reason :) In my opinion for a VM there is no reason to have fallback bootorders. You boot from disk, net or cdrom and if it does not work you fix your VM setup and restart. This is not like a real PC where changing boot order is more tricky. > And -B should have options vm.conf. vm.conf should always have the same > or more and not less options. The vm.conf grammar, on the other hand, > allows to add more complex configurations. Adding bootdevice to vm.conf should be easy to do. I was just not sure if it is really required since it is kind of a special case boot (caused by manual intervention). > Reyk > > > Am 07.12.2018 um 20:55 schrieb Carlos Cardenas <cardena...@gmail.com>: > > > >> 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 > > > > I'm ok with this. > > > > reyk@, what are your thoughts? > > > > +--+ > > Carlos > > > >> > >> 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 > >> > -- :wq Claudio