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

From: Mario Marietto <marietto2008_at_gmail.com>
Date: Tue, 02 Jul 2024 17:21:36 UTC
Hello.

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

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

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

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

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

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.

-- 
Mario.