Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
server: add a first-class error type to machine init
Add a `MachineInitError` type and make `MachineInitializer` functions return it. This makes it more convenient to handle new logic errors in initializer functions. To handle the (many) cases where the initializer calls bhyve ioctls or filesystem functions that return `std::io:Error`, `MachineInitError` has a catchall `anyhow::Error` variant; this encourages calls that produce I/O errors to call `context` or `with_context` to better describe those errors. Tested by running propolis-server ad hoc in a couple of invalid configurations (file backend not pointing to an actual file; too many vCPUs; more guest memory than the host has available) and verified that the error chains (and contexts, if applicable) show up in the Propolis logs.
- Loading branch information