pub fn trigger_irq(&self, irq_index: u32, vector: u32) -> Result<()> {
        let irq = self
            .irqs
            .get(&irq_index)
            .ok_or(VfioError::VfioDeviceTriggerIrq)?;
        if irq.count <= vector {
            return Err(VfioError::VfioDeviceTriggerIrq);
        }

        let mut irq_set = vec_with_array_field::<vfio_irq_set, u32>(0);
        irq_set[0].argsz = mem::size_of::<vfio_irq_set>() as u32;
        irq_set[0].flags = VFIO_IRQ_SET_DATA_NONE | VFIO_IRQ_SET_ACTION_TRIGGER;
        irq_set[0].index = irq_index;
        irq_set[0].start = vector;
        irq_set[0].count = 1;

        vfio_syscall::set_device_irqs(self, irq_set.as_slice())
            .map_err(|_| VfioError::VfioDeviceTriggerIrq)
    }
/// Trigger a VFIO device IRQ from userspace.
///
/// Once a signaling mechanism is set, DATA_BOOL or DATA_NONE can be used with ACTION_TRIGGER
/// to perform kernel level interrupt loopback testing from userspace (ie. simulate hardware
/// triggering).
///
/// # Arguments
/// * `irq_index` - The type (INTX, MSI or MSI-X) of interrupts to enable.
/// * `vector` - The sub-index into the interrupt group of `irq_index`.
Trigger a VFIO device IRQ from userspace.
Once a signaling mechanism is set, DATA_BOOL or DATA_NONE can be used with ACTION_TRIGGER
to perform kernel level interrupt loopback testing from userspace .
Trigger a VFIO device IRQ from userspace . Once a signaling mechanism is set DATA_BOOL or DATA_NONE can be used with ACTION_TRIGGER to perform kernel level interrupt loopback testing from userspace .
pub fn trigger_irq(&self, irq_index: u32, vector: u32) -> Result<()> {
        let irq = self
            .irqs
            .get(&irq_index)
            .ok_or(VfioError::VfioDeviceTriggerIrq)?;
        if irq.count <= vector {
            return Err(VfioError::VfioDeviceTriggerIrq);
        }
        let mut irq_set = vec_with_array_field::<vfio_irq_set, u32>(0);
        irq_set[0].argsz = mem::size_of::<vfio_irq_set>() as u32;
        irq_set[0].flags = VFIO_IRQ_SET_DATA_NONE | VFIO_IRQ_SET_ACTION_TRIGGER;
        irq_set[0].index = irq_index;
        irq_set[0].start = vector;
        irq_set[0].count = 1;
        vfio_syscall::set_device_irqs(self, irq_set.as_slice())
            .map_err(|_| VfioError::VfioDeviceTriggerIrq)
    }
pub fn trigger_irq ( & self , irq_index : u32 , vector : u32 ) -> Result < ( ) > { let irq = self . irqs . get ( & irq_index ) . ok_or ( VfioError :: VfioDeviceTriggerIrq ) ? ; if irq . count <= vector { return Err ( VfioError :: VfioDeviceTriggerIrq ) ; } let mut irq_set = vec_with_array_field :: < vfio_irq_set , u32 > ( 0 ) ; irq_set [ 0 ] . argsz = mem :: size_of :: < vfio_irq_set > ( ) as u32 ; irq_set [ 0 ] . flags = VFIO_IRQ_SET_DATA_NONE | VFIO_IRQ_SET_ACTION_TRIGGER ; irq_set [ 0 ] . index = irq_index ; irq_set [ 0 ] . start = vector ; irq_set [ 0 ] . count = 1 ; vfio_syscall :: set_device_irqs ( self , irq_set . as_slice ( ) ) . map_err ( | _ | VfioError :: VfioDeviceTriggerIrq ) }
Trigger a VFIO device IRQ from userspace.
Trigger a VFIO device IRQ from userspace .
&self
irq_index
u32
vector
u32