mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-22 12:35:19 +00:00
Revert "vmm: vm: Unpark the threads before shutdown when the current state is paused"
This reverts commit e1a07ce3c42f771364078a526db00ab2029c0e37. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
797cd13dcc
commit
cd60de8f7f
@ -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(())
|
||||
|
Loading…
x
Reference in New Issue
Block a user