mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-08-23 16:31:16 +00:00
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:
parent
797cd13dcc
commit
cd60de8f7f
@ -589,15 +589,10 @@ impl Vm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn shutdown(&mut self) -> Result<()> {
|
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;
|
let new_state = VmState::Shutdown;
|
||||||
|
|
||||||
current_state.valid_transition(new_state)?;
|
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)?;
|
|
||||||
}
|
|
||||||
|
|
||||||
if self.on_tty {
|
if self.on_tty {
|
||||||
// Don't forget to set the terminal in canonical mode
|
// Don't forget to set the terminal in canonical mode
|
||||||
@ -623,8 +618,6 @@ impl Vm {
|
|||||||
for thread in self.threads.drain(..) {
|
for thread in self.threads.drain(..) {
|
||||||
thread.join().map_err(Error::ThreadCleanup)?
|
thread.join().map_err(Error::ThreadCleanup)?
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut state = self.state.try_write().map_err(|_| Error::PoisonedState)?;
|
|
||||||
*state = new_state;
|
*state = new_state;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
Loading…
Reference in New Issue
Block a user