This change introduces libbhyve, a private library containing
bhyve-specific routines meant to be shared with other userspace programs.
This refactor aims to solve several problems that make it
impossible to hotplug emulated PCI devices in bhyve:
- bhyve is sandboxed and thus can't open any additional files during runtime, which makes it impossible to initialize certain emulated PCI devices during runtime. This refactor makes it possible for another program to reuse the initialization code to open those files and send the descriptors to bhyve via a UNIX socket.
- Emulated PCI devices may require certain nvlist(9) name value pairs to be present during initialization. This refactor allows another program to reuse the configuration parsing logic (i.e., per-device pe_legacy_config methods) and send a properly populated nvlist(9) object to bhyve.
This is why the initial version of the library contains bhyve's
configuration management code and a set of routines for initializing
hotpluggable emulated PCI devices.
This will also allow us to share parts of bhyve's device initialization
routines with bhyvectl without code duplication.
No functional change intended.