Page MenuHomeFreeBSD

bhyve: allow overriding snapshot socket directory
AcceptedPublic

Authored by novel on Sun, Jun 7, 7:46 AM.
Tags
None
Referenced Files
F160430759: D57494.diff
Wed, Jun 24, 8:46 AM
Unknown Object (File)
Sat, Jun 20, 8:32 AM
Unknown Object (File)
Mon, Jun 15, 6:45 PM
Unknown Object (File)
Mon, Jun 15, 6:45 PM
Unknown Object (File)
Fri, Jun 12, 11:03 PM
Unknown Object (File)
Fri, Jun 12, 8:24 PM
Unknown Object (File)
Thu, Jun 11, 10:07 AM
Unknown Object (File)
Mon, Jun 8, 1:54 AM

Details

Reviewers
bcr
Group Reviewers
bhyve
manpages
Summary

By default bhyve(8) creates a snapshot socket in
"/var/run/bhyve/" (BHYVE_RUN_DIR).
As this is a system directory not writable by users,
this does not work when bhyve(8) is being started
as a non-root user.

Address that by allowing to override this directory.
In bhyve(8) it is done by setting 'rundir' option
with '-o rundir=<path>'.

In bhyvectl(8) it is done with '--rundir=<path>'.

Test Plan

sudo -u bhyve -g vmm bhyve -M -c 2 -m 4096 -o pci.enable_bars=1 -u -H -P \

-s 0:0,hostbridge -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \
-s 2:0,xhci,tablet -s 1:0,lpc \
-s 3:0,ahci,cd:/data/isos/alpine-standard-3.23.4-x86_64.iso \
-s 6:0,fbuf,tcp=127.0.0.1:5901 \
-l com1,stdio \
-o rundir=/tmp/bhyve_run \
alpine

sudo -u bhyve -g vmm bhyvectl --checkpoint=/tmp/vm --vm=alpine --rundir=/tmp/bhyve_run

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 74206
Build 71089: arc lint + arc unit

Event Timeline

novel requested review of this revision.Sun, Jun 7, 7:46 AM
bnovkov added inline comments.
usr.sbin/bhyve/amd64/bhyverun_machdep.c
71

This will fail to compile on a non-BHYVE_SNAPSHOT build otherwise.

usr.sbin/bhyvectl/bhyvectl.c
160

Isn't this array supposed to hold information about the type of the argument? Would it make more sense to put "path" here?

393–394
547–550

One more thing, could you please document this feature in bhyve's manpage?

This is cool! Please add the docs to bhyvectl as well!

usr.sbin/bhyve/bhyve_config.5
229

Use the Pa macro to add filesystem paths to the whatis database. This facilitates searching the manual by filename.

Address review comments about manpages.

bcr added a subscriber: bcr.

The manpage looks good now, thanks!

This revision is now accepted and ready to land.Wed, Jun 24, 5:36 PM
usr.sbin/bhyvectl/bhyvectl.8
43

We need it here too.