Revert "vmm: vm: Unpark the threads before shutdown when the current state is paused"

This reverts commit e1a07ce3c4.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2020-05-06 10:10:58 +01:00 committed by Sebastien Boeuf
parent 797cd13dcc
commit cd60de8f7f

View File

@ -589,15 +589,10 @@ impl Vm {
}
pub fn shutdown(&mut self) -> Result<()> {
let current_state = self.get_state()?;
let mut state = self.state.try_write().map_err(|_| Error::PoisonedState)?;
let new_state = VmState::Shutdown;
current_state.valid_transition(new_state)?;
// If the current state is paused that means most of the handles got killed by pthread_kill
// We need to unpark those threads by calling resume
if current_state == VmState::Paused {
self.resume().map_err(Error::Resume)?;
}
state.valid_transition(new_state)?;
if self.on_tty {
// Don't forget to set the terminal in canonical mode
@ -623,8 +618,6 @@ impl Vm {
for thread in self.threads.drain(..) {
thread.join().map_err(Error::ThreadCleanup)?
}
let mut state = self.state.try_write().map_err(|_| Error::PoisonedState)?;
*state = new_state;
Ok(())