mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-08-23 08:21:15 +00:00
vmm: move kvm feature gate right before the if condition
This change uses the kvm feature gate cleaner way in the handling of PIO/MMIO exits. Signed-off-by: Muminul Islam <muislam@microsoft.com>
This commit is contained in:
parent
7d8f795430
commit
06e583c9ab
@ -920,15 +920,13 @@ impl CpuManager {
|
|||||||
// to be executed.
|
// to be executed.
|
||||||
|
|
||||||
#[cfg(feature = "kvm")]
|
#[cfg(feature = "kvm")]
|
||||||
{
|
if matches!(hypervisor_type, HypervisorType::Kvm) {
|
||||||
if matches!(hypervisor_type, HypervisorType::Kvm) {
|
vcpu.lock().as_ref().unwrap().vcpu.set_immediate_exit(true);
|
||||||
vcpu.lock().as_ref().unwrap().vcpu.set_immediate_exit(true);
|
if !matches!(vcpu.lock().unwrap().run(), Ok(VmExit::Ignore)) {
|
||||||
if !matches!(vcpu.lock().unwrap().run(), Ok(VmExit::Ignore)) {
|
error!("Unexpected VM exit on \"immediate_exit\" run");
|
||||||
error!("Unexpected VM exit on \"immediate_exit\" run");
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
vcpu.lock().as_ref().unwrap().vcpu.set_immediate_exit(false);
|
|
||||||
}
|
}
|
||||||
|
vcpu.lock().as_ref().unwrap().vcpu.set_immediate_exit(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
vcpu_run_interrupted.store(true, Ordering::SeqCst);
|
vcpu_run_interrupted.store(true, Ordering::SeqCst);
|
||||||
|
Loading…
Reference in New Issue
Block a user