From ee5143afffb0cc6212e91cb5cacb5cc67c065bd3 Mon Sep 17 00:00:00 2001 From: brad Date: Tue, 1 Feb 2022 09:17:51 -0800 Subject: [PATCH 1/2] add request_interrupt_window handling --- src/ioctls/vcpu.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ioctls/vcpu.rs b/src/ioctls/vcpu.rs index c5e57c6f..b18c029d 100644 --- a/src/ioctls/vcpu.rs +++ b/src/ioctls/vcpu.rs @@ -1403,6 +1403,12 @@ impl VcpuFd { kvm_run.immediate_exit = val; } + /// Sets the `request_interrupt_window` flag on the `kvm_run` struct associated with this vCPU to `val`. + pub fn set_kvm_request_interrupt_window(&self, val: u8) { + let kvm_run = self.kvm_run_ptr.as_mut_ref(); + kvm_run.request_interrupt_window = val; + } + /// Returns the vCPU TSC frequency in KHz or an error if the host has unstable TSC. /// /// # Example @@ -1428,6 +1434,8 @@ impl VcpuFd { } } + + /// Sets the specified vCPU TSC frequency. /// /// # Arguments From 8e6e66b565c28bbce4770cd7efc36002ad5459b6 Mon Sep 17 00:00:00 2001 From: brad Date: Sat, 5 Feb 2022 15:15:36 -0800 Subject: [PATCH 2/2] add get_ready_for_interrupt_injection --- src/ioctls/vcpu.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ioctls/vcpu.rs b/src/ioctls/vcpu.rs index b18c029d..5ebad903 100644 --- a/src/ioctls/vcpu.rs +++ b/src/ioctls/vcpu.rs @@ -1409,6 +1409,12 @@ impl VcpuFd { kvm_run.request_interrupt_window = val; } + /// Gets the `ready_for_interrupt_injection` flag on the `kvm_run` struct associated with this vCPU to `val`. + pub fn get_ready_for_interrupt_injection(&self) -> u8 { + let kvm_run = self.kvm_run_ptr.as_mut_ref(); + return kvm_run.ready_for_interrupt_injection; + } + /// Returns the vCPU TSC frequency in KHz or an error if the host has unstable TSC. /// /// # Example