vmm: Move the tty setting to the VM start routine

We want to shrink the control loop to a bare minimal.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
Samuel Ortiz 2019-09-24 16:06:56 +02:00
parent 2e9d815701
commit e6ef9ece2c

View File

@ -851,13 +851,6 @@ impl Vm {
let mut events = vec![epoll::Event::new(epoll::Events::empty(), 0); EPOLL_EVENTS_LEN];
let epoll_fd = self.epoll.as_raw_fd();
if self.devices.console().input_enabled() && self.on_tty {
io::stdin()
.lock()
.set_raw_mode()
.map_err(Error::SetTerminalRaw)?;
}
let exit_behaviour;
'outer: loop {
@ -1044,7 +1037,15 @@ impl Vm {
}
Err(e) => error!("Signal not found {}", e),
}
if self.on_tty {
io::stdin()
.lock()
.set_raw_mode()
.map_err(Error::SetTerminalRaw)?;
}
}
self.control_loop()
}