pub struct Interrupt {
inner: Arc<InterruptInner>,
}Fields§
§inner: Arc<InterruptInner>Implementations§
Source§impl Interrupt
impl Interrupt
Sourcepub fn signal(&self, vector: u16, interrupt_status_mask: u32)
pub fn signal(&self, vector: u16, interrupt_status_mask: u32)
Writes to the irqfd to VMM to deliver virtual interrupt to the guest.
If MSI-X is enabled in this device, MSI-X interrupt is preferred. Write to the irqfd to VMM to deliver virtual interrupt to the guest
Sourcepub fn signal_used_queue(&self, vector: u16)
pub fn signal_used_queue(&self, vector: u16)
Notify the driver that buffers have been placed in the used queue.
Sourcepub fn signal_config_changed(&self)
pub fn signal_config_changed(&self)
Notify the driver that the device configuration has changed.
Sourcefn get_resample_evt(&self) -> Option<&Event>
fn get_resample_evt(&self) -> Option<&Event>
Get the event to signal resampling is needed if it exists.
pub fn spawn_resample_thread(&self) -> Option<WorkerThread<()>>
Source§impl Interrupt
impl Interrupt
pub fn new( irq_evt_lvl: IrqLevelEvent, msix_config: Option<Arc<Mutex<MsixConfig>>>, config_msix_vector: u16, wakeup_event: Option<(PmWakeupEvent, MetricEventType)>, ) -> Interrupt
Sourcepub fn new_from_snapshot(
irq_evt_lvl: IrqLevelEvent,
msix_config: Option<Arc<Mutex<MsixConfig>>>,
config_msix_vector: u16,
snapshot: InterruptSnapshot,
wakeup_event: Option<(PmWakeupEvent, MetricEventType)>,
) -> Interrupt
pub fn new_from_snapshot( irq_evt_lvl: IrqLevelEvent, msix_config: Option<Arc<Mutex<MsixConfig>>>, config_msix_vector: u16, snapshot: InterruptSnapshot, wakeup_event: Option<(PmWakeupEvent, MetricEventType)>, ) -> Interrupt
Create a new Interrupt, restoring internal state to match snapshot.
The other arguments are assumed to be snapshot’d and restore’d elsewhere.
pub fn new_mmio( irq_evt_edge: IrqEdgeEvent, async_intr_status: bool, ) -> Interrupt
Sourcepub fn new_vhost_user(
call_evt: Event,
signal_config_changed_fn: Box<dyn Fn() + Send + Sync>,
) -> Interrupt
pub fn new_vhost_user( call_evt: Event, signal_config_changed_fn: Box<dyn Fn() + Send + Sync>, ) -> Interrupt
Create an Interrupt wrapping a vhost-user vring call event and function that sends a
VHOST_USER_BACKEND_CONFIG_CHANGE_MSG to the frontend.
Sourcepub fn get_interrupt_evt(&self) -> &Event
pub fn get_interrupt_evt(&self) -> &Event
Get a reference to the interrupt event.
Sourcepub fn get_msix_config(&self) -> &Option<Arc<Mutex<MsixConfig>>>
pub fn get_msix_config(&self) -> &Option<Arc<Mutex<MsixConfig>>>
Get a reference to the msix configuration
Sourcepub fn read_interrupt_status(&self) -> u8
pub fn read_interrupt_status(&self) -> u8
Reads the current value of the interrupt status.
Sourcepub fn read_and_reset_interrupt_status(&self) -> u8
pub fn read_and_reset_interrupt_status(&self) -> u8
Reads the current value of the interrupt status and resets it to 0.
Sourcepub fn clear_interrupt_status_bits(&self, mask: u8)
pub fn clear_interrupt_status_bits(&self, mask: u8)
Clear the bits set in mask in the interrupt status.
Sourcepub fn snapshot(&self) -> InterruptSnapshot
pub fn snapshot(&self) -> InterruptSnapshot
Snapshot internal state. Can be restored with with Interrupt::new_from_snapshot.