vmm: Add a VM stop method

In order to transfer the control loop to a separate VMM thread, we want
to shrink the VM control loop to a bare minimum.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
Samuel Ortiz
2019-09-24 16:14:04 +02:00
parent e6ef9ece2c
commit ea7abc6c80
2 changed files with 12 additions and 1 deletions

View File

@@ -909,6 +909,10 @@ impl Vm {
}
}
Ok(exit_behaviour)
}
pub fn stop(&mut self) -> Result<()> {
if self.on_tty {
// Don't forget to set the terminal in canonical mode
// before to exit.
@@ -941,7 +945,7 @@ impl Vm {
thread.join().map_err(|_| Error::ThreadCleanup)?
}
Ok(exit_behaviour)
Ok(())
}
fn os_signal_handler(signals: Signals, console_input_clone: Arc<Console>) {