mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +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:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user