Skip to main content

inject_interrupt

Function inject_interrupt 

Source
pub fn inject_interrupt(vm_id: VMId, vcpu_id: VCpuId, vector: InterruptVector)
Expand description

Inject an interrupt into a specific virtual CPU.

This function queues an interrupt to be delivered to the specified vCPU when it is next scheduled.

§Arguments

  • vm_id - The identifier of the target virtual machine.
  • vcpu_id - The identifier of the target virtual CPU.
  • vector - The interrupt vector to inject.

§Example

use axvisor_api::vmm::{inject_interrupt, current_vm_id};

// Inject timer interrupt (vector 0x20) to vCPU 0 of the current VM
inject_interrupt(current_vm_id(), 0, 0x20);