mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-23 06:05:21 +00:00
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 <robert.bradford@intel.com>
This commit is contained in:
parent
e12179a3e6
commit
dd82064aba
@ -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) => {
|
||||
|
Loading…
Reference in New Issue
Block a user