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)
Mon, Aug 17, 9:39 PM
Unknown Object (File)
Wed, Aug 12, 3:10 PM
Unknown Object (File)
Mon, Aug 10, 8:24 PM
Unknown Object (File)
Mon, Aug 10, 6:21 PM
Unknown Object (File)
Mon, Aug 10, 10:22 AM
Unknown Object (File)
Mon, Aug 10, 10:22 AM
Unknown Object (File)
Mon, Aug 10, 9:44 AM
Unknown Object (File)
Sun, Aug 9, 12:36 AM
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 62208
Build 59092: 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.