mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-23 04:55:22 +00:00
main: Fix error propagation if starting the VM fails
Commit 21d40d7 ("main: reset tty if starting the VM fails") changed start_vmm() to join the vmm thread if an error happens after the vmm thread is started. The implementation put all the error-prone code that is run after the vmm is started in a closure, to be able to always join the vmm thread, regardless of any error happening. However, it missed propagating the error that might happen inside the closure back to the main function, after joining the vmm thread. For some cmd line options, the above issue inhibits proper error reporting when starting a VM with invalid commands, as many parameters are parsed after the vmm is started, thus if such parsing fails, no error will be reported back to the user. See: #5435 Fixes: 21d40d7 ("main: reset tty if starting the VM fails") Signed-off-by: Rafael Mendonca <rafaelmendsr@gmail.com>
This commit is contained in:
parent
ea1a05f846
commit
81a4274738
@ -573,7 +573,7 @@ fn start_vmm(toplevel: TopLevel) -> Result<Option<String>, Error> {
|
||||
.map_err(Error::ThreadJoin)?
|
||||
.map_err(Error::VmmThread)?;
|
||||
|
||||
Ok(api_socket_path)
|
||||
r.map(|_| api_socket_path)
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user