Page MenuHomeFreeBSD

bhyve: Add partial support for multiple config node values
AcceptedPublic

Authored by markj on Nov 13 2023, 7:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sep 26 2024, 8:53 AM
Unknown Object (File)
Sep 5 2024, 8:15 PM
Unknown Object (File)
Jul 30 2024, 1:10 PM
Unknown Object (File)
Jul 5 2024, 12:07 PM
Unknown Object (File)
Jul 3 2024, 11:39 AM
Unknown Object (File)
Jul 3 2024, 11:29 AM
Unknown Object (File)
Jun 29 2024, 12:24 AM
Unknown Object (File)
Apr 28 2024, 7:05 AM

Details

Reviewers
jhb
corvink
Group Reviewers
bhyve
Summary

To support the slirp networking backend, it's useful to be able to
specify multiple host forwarding rules in the form
hostfwd=<rule1>,hostfwd=<rule2>,...

However, the config parser doesn't handle this possibility. Extend the
config interface to support it by adding set_config_value_node_dupok()
and a callback interface to iterate over duplicate values.

This review is just for discussion of the approach. For the slirp
backend I have another solution which simply involves using a different
delimiter: hostfwd=<rule1>;<rule2>;...

Diff Detail

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

Event Timeline

markj requested review of this revision.Nov 13 2023, 7:04 PM
corvink added a subscriber: corvink.
corvink added inline comments.
usr.sbin/bhyve/config.c
409–413
This revision is now accepted and ready to land.Nov 14 2023, 7:39 AM

FWIW, I really would like to replace the nvlist with a tree of std::map<>. This would require converting bhyve to be a C++ binary, but only config.c would need to be a C++ file for now I think. With a suitable typedef to represent a node in place of nvlist_t I think you could hide most of that under the hood.

usr.sbin/bhyve/config.h
111

Maybe "add_config_value_node"?