vmm: Resume devices after vCPUs have been resumed

Because we don't want the guest to miss any event triggered by the
emulation of devices, it is important to resume all vCPUs before we can
resume the DeviceManager with all its associated devices.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf 2020-06-25 09:58:13 +02:00
parent f6eeba781b
commit 86377127df

View File

@ -1162,7 +1162,6 @@ impl Pausable for Vm {
.valid_transition(new_state)
.map_err(|e| MigratableError::Resume(anyhow!("Invalid transition: {:?}", e)))?;
self.device_manager.lock().unwrap().resume()?;
self.cpu_manager.lock().unwrap().resume()?;
#[cfg(target_arch = "x86_64")]
{
@ -1172,6 +1171,7 @@ impl Pausable for Vm {
})?;
}
}
self.device_manager.lock().unwrap().resume()?;
// And we're back to the Running state.
*state = new_state;