pub struct Interrupt {
    inner: Arc<InterruptInner>,
}

Fields§

§inner: Arc<InterruptInner>

Implementations§

source§

impl Interrupt

source

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

source

pub fn signal_used_queue(&self, vector: u16)

Notify the driver that buffers have been placed in the used queue.

source

pub fn signal_config_changed(&self)

Notify the driver that the device configuration has changed.

source

pub fn get_resample_evt(&self) -> Option<&Event>

Get the event to signal resampling is needed if it exists.

source

pub fn do_interrupt_resample(&self)

Reads the status and writes to the interrupt event. Doesn’t read the resample event, it assumes the resample has been requested.

source§

impl Interrupt

source

pub fn new( irq_evt_lvl: IrqLevelEvent, msix_config: Option<Arc<Mutex<MsixConfig>>>, config_msix_vector: u16, wakeup_event: Option<PmWakeupEvent> ) -> Interrupt

source

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> ) -> Interrupt

Create a new Interrupt, restoring internal state to match snapshot.

The other arguments are assumed to be snapshot’d and restore’d elsewhere.

source

pub fn new_mmio( irq_evt_edge: IrqEdgeEvent, async_intr_status: bool ) -> Interrupt

source

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.

source

pub fn get_interrupt_evt(&self) -> &Event

Get a reference to the interrupt event.

source

pub fn interrupt_resample(&self)

Handle interrupt resampling event, reading the value from the event and doing the resample.

source

pub fn get_msix_config(&self) -> &Option<Arc<Mutex<MsixConfig>>>

Get a reference to the msix configuration

source

pub fn read_interrupt_status(&self) -> u8

Reads the current value of the interrupt status.

source

pub fn read_and_reset_interrupt_status(&self) -> u8

Reads the current value of the interrupt status and resets it to 0.

source

pub fn clear_interrupt_status_bits(&self, mask: u8)

Clear the bits set in mask in the interrupt status.

source

pub fn snapshot(&self) -> InterruptSnapshot

Snapshot internal state. Can be restored with with Interrupt::new_from_snapshot.

source

pub fn set_wakeup_event_active(&self, active: bool)

Trait Implementations§

source§

impl Clone for Interrupt

source§

fn clone(&self) -> Interrupt

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast for Twhere T: Any,

§

fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>

Convert 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, Global>) -> Rc<dyn Any, Global>

Convert 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)

Convert &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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for Twhere T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T, Global>) -> Arc<dyn Any + Sync + Send, Global>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V