vmm: Notify the guest about vCPUs being paused

Through the newly added API notify_guest_clock_paused(), this patch
improves the vCPU pause operation by letting the guest know that each
vCPU is being paused. This is important to avoid soft lockups detection
from the guest that could happen because the VM has been paused for more
than 20 seconds.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf 2020-06-17 13:11:26 +02:00
parent 309924eca8
commit 4a81d65f79

View File

@ -1322,6 +1322,20 @@ impl Pausable for CpuManager {
state.signal_thread();
}
#[cfg(target_arch = "x86_64")]
for vcpu in self.vcpus.iter() {
vcpu.lock()
.unwrap()
.fd
.notify_guest_clock_paused()
.map_err(|e| {
MigratableError::Pause(anyhow!(
"Could not notify guest it has been paused {:?}",
e
))
})?;
}
Ok(())
}