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)
Fri, Mar 14, 12:47 PM
Unknown Object (File)
Thu, Mar 6, 10:03 PM
Unknown Object (File)
Sun, Mar 2, 1:16 PM
Unknown Object (File)
Thu, Feb 27, 10:35 PM
Unknown Object (File)
Sun, Feb 23, 1:28 PM
Unknown Object (File)
Tue, Feb 18, 10:31 PM
Unknown Object (File)
Feb 17 2025, 2:09 AM
Unknown Object (File)
Feb 12 2025, 9:33 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.