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)
Sun, Apr 28, 7:05 AM
Unknown Object (File)
Tue, Apr 23, 2:34 AM
Unknown Object (File)
Jan 17 2024, 12:01 PM
Unknown Object (File)
Jan 15 2024, 3:40 PM
Unknown Object (File)
Jan 10 2024, 8:08 PM
Unknown Object (File)
Dec 27 2023, 10:37 AM
Unknown Object (File)
Dec 20 2023, 8:30 AM
Unknown Object (File)
Dec 20 2023, 7:52 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"?