This proposed patch attempts to load vmm.ko if it's not already present in the kernel. If vmm.ko fails to load, an error message is produced and bhyveload exits.
Details
- ensure vmm.ko is not loaded
- invoke bhyveload
- ensure vmm.ko is loaded
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
@jhb Any objection if I proceed to commit this patch? I just hit the same situation "forgot to load vmm" and this patch does fix it.
I wonder if it makes more sense to do this in vmrun.sh? OTOH, it's probably fine to do this. We should also probably do it in bhyverun.c since bhyveload isn't used in the UEFI case. Another option would be to do this in the vm_create() wrapper in libvmmapi in which case that would fix bhyveload, grub2-bhyve, and bhyve all in one place.
Yes, I agree to do that on libvmmapi!!! I was actually think about that, because at the end I would repeat code on bhyveload and bhyverun.c
Ok, let me update this patch with the libvmmapi approach.
Thank you.
Oops, sorry not really!!! If you can go forward and do the implementation, I will be happy too. It was not my intention to taking over the review.
You’re welcome to finish it up..
I just wanted to make sure that you weren’t waiting for me to update this review.
Thanks in advance for getting these changes in.
lib/libvmmapi/vmmapi.c | ||
---|---|---|
108 ↗ | (On Diff #65702) | Tiny nit: /* Try to load the vmm(4) module before creating a guest. */ You could perhaps simplify this slightly by not worrying about errors from kldload() and letting it fall through to CREATE still in that case to report the error: if (modfind("vmm") < 0) kldload("vmm"); |