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.

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.

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
>> 

Reply via email to