mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Always reset the console mode on VMM exit
Tested: 1. SIGTERM based 2. VM shutdown/poweroff 3. Injected VM boot failure after calling Vm::setup_tty() Fixes: #4248 Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
@@ -1694,13 +1694,14 @@ impl Vm {
|
||||
console_input_clone.update_console_size();
|
||||
}
|
||||
SIGTERM | SIGINT => {
|
||||
if on_tty {
|
||||
io::stdin()
|
||||
.lock()
|
||||
.set_canon_mode()
|
||||
.expect("failed to restore terminal mode");
|
||||
}
|
||||
if exit_evt.write(1).is_err() {
|
||||
// Resetting the terminal is usually done as the VMM exits
|
||||
if on_tty {
|
||||
io::stdin()
|
||||
.lock()
|
||||
.set_canon_mode()
|
||||
.expect("failed to restore terminal mode");
|
||||
}
|
||||
std::process::exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user