bhyve How to load / unload the bhyve / vmm.ko module while FreeBSD is running...

Hello.

I'm trying to unload the vmm kernel module,but it fails :

Code:
[root@marietto /bhyve]==> kldunload -fv vmm
Unloading vmm.ko, id=13
kldunload: can't unload file: Device busy

I don't understand why it fails,since I don't have any bhyve vm currently running :

Code:
[root@marietto /bhyve]==> ps ax | grep bhyve
6645  4  RL+     0:00,00 grep bhyve (ggrep)

and yes,the vmm module is loaded in memory :

Code:
root@marietto /bhyve]==> kldstat | grep vmm
13    1 0xffffffff827ac000   37c9e8 vmm.ko

how has it been loaded inside the memory ? Using /boot/loader.conf :

Code:
vmm_load="YES"

and it is located inside the directory /boot/kernel and it is called vmm.ko

Is there a way to unload it and reload it while FreeBSD is running,without rebooting the system ? thanks.
 
I've been able to unload vmm :

Code:
[root@marietto /dev/vmm]==> bhyvectl --vm=vm0:12 --destroy

[root@marietto /dev/vmm]==> cd /dev/vmm                 
cd: no such file or directory: /dev/vmm

[root@marietto /dev/vmm]==> kldunload vmm               
OK.

but now I would like to load it again :

Code:
[root@marietto /dev/vmm]==> kldload vmm 
kldload: can't load vmm: module already loaded or in kernel

[root@marietto /dev/vmm]==> kldstat | grep vmm

[root@marietto /dev/vmm]==> ls /dev/vmm
ls: /dev/vmm: No such file or directory

---> Do you have PCI devices ( pptdevs ) reserved? See vmm(4).

Yes :

Code:
pptdevs="2/0/0 2/0/1 2/0/2 2/0/3"

on /boot/loader.conf
 
Back
Top