mirror of
https://github.com/rust-vmm/vhost-device.git
synced 2025-12-30 09:46:55 +00:00
rng: also pretty print configuration errors
If the parsed commandline options cannot be converted into a `VuRngConfig` we would only get a .unwrap() error message. Chain this before the check of the daemon launch. Suggested-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org> Signed-off-by: Erik Schilling <erik.schilling@linaro.org>
This commit is contained in:
parent
a9de87a1ce
commit
3cab62ea02
@ -170,7 +170,7 @@ pub(crate) fn start_backend(config: VuRngConfig) -> Result<()> {
|
||||
fn main() {
|
||||
env_logger::init();
|
||||
|
||||
if let Err(e) = start_backend(VuRngConfig::try_from(RngArgs::parse()).unwrap()) {
|
||||
if let Err(e) = VuRngConfig::try_from(RngArgs::parse()).and_then(start_backend) {
|
||||
error!("{e}");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user