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)
Sat, Dec 27, 12:33 AM
Unknown Object (File)
Nov 3 2025, 6:54 AM
Unknown Object (File)
Oct 29 2025, 8:09 PM
Unknown Object (File)
Oct 29 2025, 8:09 PM
Unknown Object (File)
Oct 29 2025, 8:09 PM
Unknown Object (File)
Oct 29 2025, 8:08 PM
Unknown Object (File)
Oct 29 2025, 8:07 PM
Unknown Object (File)
Oct 29 2025, 8:06 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 62240
Build 59124: arc lint + arc unit

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.