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
F171742178: D38338.diff
Sun, Sep 13, 5:02 AM
F171736917: D38338.diff
Sun, Sep 13, 3:56 AM
Unknown Object (File)
Sat, Sep 12, 9:49 AM
Unknown Object (File)
Thu, Sep 10, 11:02 PM
Unknown Object (File)
Thu, Sep 10, 12:36 PM
Unknown Object (File)
Mon, Sep 7, 11:30 PM
Unknown Object (File)
Mon, Sep 7, 2:47 AM
Unknown Object (File)
Mon, Sep 7, 2:29 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 51341
Build 48232: 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
407
584

Why not just use fstat()?

595

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
1294

EX_USAGE?

usr.sbin/bhyve/qemu_fwcfg.c
604–606
This revision is now accepted and ready to land.May 9 2023, 8:30 PM
usr.sbin/bhyve/qemu_fwcfg.c
567
583

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

585

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

601

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