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
.
pub fn set_suspended(&self, suspended: bool)
pub fn set_wakeup_event_active(&self, active: bool)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Interrupt
impl !RefUnwindSafe for Interrupt
impl Send for Interrupt
impl Sync for Interrupt
impl Unpin for Interrupt
impl !UnwindSafe for Interrupt
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.