mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-23 14:15:19 +00:00
vmm: cpu: Unpause vCPU threads
After setting the kill signal flag for the vCPU thread release the pause flag and unpark the threads. This ensures that that the vCPU thread will wake up and check the kill signal flag if the VM is paused. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
91a4a2581e
commit
801e72ac6d
@ -193,6 +193,9 @@ pub enum Error {
|
||||
|
||||
/// Failed to set KVM vcpu XCRS.
|
||||
VcpuSetXcrs(kvm_ioctls::Error),
|
||||
|
||||
/// Error resuming vCPU on shutdown
|
||||
ResumeOnShutdown(MigratableError),
|
||||
}
|
||||
pub type Result<T> = result::Result<T, Error>;
|
||||
|
||||
@ -953,6 +956,9 @@ impl CpuManager {
|
||||
// Tell the vCPUs to stop themselves next time they go through the loop
|
||||
self.vcpus_kill_signalled.store(true, Ordering::SeqCst);
|
||||
|
||||
// Clear pause state and unpark the vCPU threads if they are parked.
|
||||
self.resume().map_err(Error::ResumeOnShutdown)?;
|
||||
|
||||
// Signal to the spawned threads (vCPUs and console signal handler). For the vCPU threads
|
||||
// this will interrupt the KVM_RUN ioctl() allowing the loop to check the boolean set
|
||||
// above.
|
||||
|
Loading…
Reference in New Issue
Block a user