From d667ed0c707a8b1b414ef936851919e931350bd8 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Thu, 15 Oct 2020 14:55:50 +0000 Subject: [PATCH] vmm: don't call notify_guest_clock_paused when Hyper-V emulation is on We turn on that emulation for Windows. Windows does not have KVM's PV clock, so calling notify_guest_clock_paused results in an error. Signed-off-by: Wei Liu --- vmm/src/cpu.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/vmm/src/cpu.rs b/vmm/src/cpu.rs index 61cbaf8f0..633de16db 100644 --- a/vmm/src/cpu.rs +++ b/vmm/src/cpu.rs @@ -1357,9 +1357,14 @@ impl Pausable for CpuManager { let mut vcpu = vcpu.lock().unwrap(); vcpu.pause()?; #[cfg(target_arch = "x86_64")] - vcpu.vcpu.notify_guest_clock_paused().map_err(|e| { - MigratableError::Pause(anyhow!("Could not notify guest it has been paused {:?}", e)) - })?; + if !self.config.kvm_hyperv { + vcpu.vcpu.notify_guest_clock_paused().map_err(|e| { + MigratableError::Pause(anyhow!( + "Could not notify guest it has been paused {:?}", + e + )) + })?; + } } Ok(())