Page MenuHomeFreeBSD

bhyve: add cmdline option for user defined fw_cfg items
ClosedPublic

Authored by corvink on Feb 1 2023, 11:11 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jul 8, 4:46 AM
Unknown Object (File)
Sun, Jul 5, 2:27 AM
Unknown Object (File)
Thu, Jul 2, 11:12 AM
Unknown Object (File)
Sun, Jun 21, 7:34 PM
Unknown Object (File)
Thu, Jun 18, 3:18 AM
Unknown Object (File)
Mon, Jun 15, 4:52 PM
Unknown Object (File)
Jun 12 2026, 1:11 AM
Unknown Object (File)
Jun 9 2026, 8:18 AM
Subscribers

Details

Summary

Some guest allow to configure themself by fw_cfg. E.g. Fedora CoreOs can
be provisioned by adding a JSON file as fw_cfg item.

Diff Detail

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

Event Timeline

@markj @jhb Any complains about this? I'd like to get this merged for 14.0.

HEADS UP. I'm going to commit this tomorrow if noone complains.

usr.sbin/bhyve/qemu_fwcfg.c
406
583

Why not just use fstat()?

594

This is missing handling of errors and short reads.

  • fix style issues
  • make use of fstat
  • handle short reads

A few suggestions, but looks ok to me otherwise.

usr.sbin/bhyve/bhyverun.c
1292

EX_USAGE?

usr.sbin/bhyve/qemu_fwcfg.c
603–605
This revision is now accepted and ready to land.May 9 2023, 8:30 PM
usr.sbin/bhyve/qemu_fwcfg.c
566
582

This can be warn() instead of warnx().

584

close() would generally clobber errno. So we either need to save/restore it, or just return -1.

600

Same comment about errno. Also a short read is not necessarily an error.