From dd82064aba78c69e7baa2f0654beafaa7c351eda Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Mon, 20 Jan 2020 14:38:03 +0000 Subject: [PATCH] main: Delay converting command line to VM params Generate the VM params until after the logging has been enabled. This will make it possible to reuse the logging for vhost backends. Signed-off-by: Rob Bradford --- src/main.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 975eba47d..113c557a4 100755 --- a/src/main.rs +++ b/src/main.rs @@ -289,8 +289,6 @@ fn main() { ) .get_matches(); - let vm_params = config::VmParams::from_arg_matches(&cmd_arguments); - let log_level = match cmd_arguments.occurrences_of("v") { 0 => LevelFilter::Error, 1 => LevelFilter::Warn, @@ -315,6 +313,7 @@ fn main() { .map(|()| log::set_max_level(log_level)) .expect("Expected to be able to setup logger"); + let vm_params = config::VmParams::from_arg_matches(&cmd_arguments); let vm_config = match config::VmConfig::parse(vm_params) { Ok(config) => config, Err(e) => {