diff --git a/src/firecracker/src/main.rs b/src/firecracker/src/main.rs index b39ef1cbf67..5b237b02bae 100644 --- a/src/firecracker/src/main.rs +++ b/src/firecracker/src/main.rs @@ -104,25 +104,6 @@ fn main() -> ExitCode { fn main_exec() -> Result<(), MainError> { // Initialize the logger. LOGGER.init().map_err(MainError::SetLogger)?; - info!("Running Firecracker v{FIRECRACKER_VERSION}"); - - register_signal_handlers().map_err(MainError::RegisterSignalHandlers)?; - - #[cfg(target_arch = "aarch64")] - enable_ssbd_mitigation(); - - if let Err(err) = resize_fdtable() { - match err { - // These errors are non-critical: In the worst case we have worse snapshot restore - // performance. - ResizeFdTableError::GetRlimit | ResizeFdTableError::Dup2(_) => { - debug!("Failed to resize fdtable: {err}") - } - // This error means that we now have a random file descriptor lying around, abort to be - // cautious. - ResizeFdTableError::Close(_) => return Err(MainError::ResizeFdtable(err)), - } - } // We need this so that we can reset terminal to canonical mode if panic occurs. let stdin = io::stdin(); @@ -281,6 +262,26 @@ fn main_exec() -> Result<(), MainError> { return Ok(()); } + info!("Running Firecracker v{FIRECRACKER_VERSION}"); + + register_signal_handlers().map_err(MainError::RegisterSignalHandlers)?; + + #[cfg(target_arch = "aarch64")] + enable_ssbd_mitigation(); + + if let Err(err) = resize_fdtable() { + match err { + // These errors are non-critical: In the worst case we have worse snapshot restore + // performance. + ResizeFdTableError::GetRlimit | ResizeFdTableError::Dup2(_) => { + debug!("Failed to resize fdtable: {err}") + } + // This error means that we now have a random file descriptor lying around, abort to be + // cautious. + ResizeFdTableError::Close(_) => return Err(MainError::ResizeFdtable(err)), + } + } + // Display warnings for any used deprecated parameters. // Currently unused since there are no deprecated parameters. Uncomment the line when // deprecating one.