Skip to content

vm-util: fix vmm module detection#118

Open
Wrench56 wants to merge 1 commit intofreebsd:masterfrom
Wrench56:master
Open

vm-util: fix vmm module detection#118
Wrench56 wants to merge 1 commit intofreebsd:masterfrom
Wrench56:master

Conversation

@Wrench56
Copy link
Copy Markdown

@Wrench56 Wrench56 commented Apr 5, 2026

Fixes a long-standing bug.

As seen below, the method to use kdlstat -qm vmm does not actually catch the loaded vmm.ko module. For some reason, kldstat -qn vmm or the more verbose kldstat -qn vmm.ko does. Without much change, I added a way to use the -qn flag for vmm specifically, but not for other modules that would break using the -qn flag (nmdm, if_bridge, if_tuntap, if_tap).

$ kldstat
Id Refs Address                Size Name
 1   54 0xffffffff80200000  1f4daa0 kernel
 2    1 0xffffffff8214e000    1c708 geom_eli.ko
 3    1 0xffffffff8216b000   620c10 zfs.ko
 4    1 0xffffffff83310000     3390 acpi_wmi.ko
 5    1 0xffffffff83314000     21e8 hcons.ko
 6    2 0xffffffff83317000     30a8 hidmap.ko
 7    1 0xffffffff8331b000     21e8 hsctrl.ko
 8    1 0xffffffff8331e000     4250 ichsmb.ko
 9    1 0xffffffff83323000     2178 smbus.ko
10    1 0xffffffff83326000     2110 pchtherm.ko
11    1 0xffffffff83329000     2a80 mac_ntpd.ko
12    2 0xffffffff8332c000    64bc8 pf.ko
13    1 0xffffffff83391000     21e8 pflog.ko
14    1 0xffffffff83400000   340438 vmm.ko
$ kldstat -qm vmm
$ echo "$?"
1
$ kldstat -qn vmm
$ echo "$?"
0

Although the issue I linked talks about FreeBSD version 12.0, it very much still persists on newer versions:

FreeBSD ******** 15.0-RELEASE FreeBSD 15.0-RELEASE releng/15.0-n280995-7aedc8de6446 GENERIC amd64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant