diff --git a/vmm/src/cpu.rs b/vmm/src/cpu.rs index 38dab7091..8c8c7a0b4 100644 --- a/vmm/src/cpu.rs +++ b/vmm/src/cpu.rs @@ -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 = result::Result; @@ -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.