Page MenuHomeFreeBSD

libvmmapi: Fix auto-loading of vmm.ko
ClosedPublic

Authored by markj on Feb 2 2025, 9:45 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, May 24, 9:09 PM
Unknown Object (File)
Thu, May 21, 6:05 PM
Unknown Object (File)
Thu, May 21, 5:03 AM
Unknown Object (File)
Wed, May 20, 6:52 PM
Unknown Object (File)
Sat, May 16, 8:29 PM
Unknown Object (File)
Sun, May 10, 8:17 AM
Unknown Object (File)
Apr 28 2026, 8:18 PM
Unknown Object (File)
Apr 28 2026, 5:05 PM
Subscribers

Details

Summary
  • We should autoload vmm.ko when creating a VM with vm_openf(), to preserve behaviour prior to commit 99127fd10362.
  • kldload(2) returns a non-zero value upon success, so the existing code was wrong.

Reported by: olivier
Fixes: 99127fd10362 ("libvmmapi: Use the vmmctl device file to create and destroy VMs")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.Feb 2 2025, 9:45 PM

I don't really like the auto-loading, but that's how it used to work, and changing it in 15.0 would be a POLA violation.

lib/libvmmapi/vmmapi.c
119

Why is this vm_device_open(name) instead of vm_ctl_open()?

Fix a silly mistake in the legacy vm_create().

I'm somewhat ambivalent about the auto-loading. I might have preferred some sort of "vmm_init" function in the library that handled that, but that ship has sailed.

This revision is now accepted and ready to land.Feb 4 2025, 3:51 PM
This revision was automatically updated to reflect the committed changes.