Enum VmIrqRequest

Source
pub enum VmIrqRequest {
    AllocateOneMsi {
        irqfd: Event,
        device_id: DeviceId,
        queue_id: usize,
        device_name: String,
    },
    AllocateOneMsiAtGsi {
        irqfd: Event,
        gsi: u32,
        device_id: DeviceId,
        queue_id: usize,
        device_name: String,
    },
    AddMsiRoute {
        gsi: u32,
        msi_address: u64,
        msi_data: u32,
    },
    ReleaseOneIrq {
        gsi: u32,
        irqfd: Event,
    },
}

Variants§

§

AllocateOneMsi

Allocate one gsi, and associate gsi to irqfd with register_irqfd()

Fields

§irqfd: Event
§device_id: DeviceId
§queue_id: usize
§device_name: String
§

AllocateOneMsiAtGsi

Allocate a specific gsi to irqfd with register_irqfd(). This must only be used when it is known that the gsi is free. Only the snapshot subsystem can make this guarantee, and use of this request by any other caller is strongly discouraged.

Fields

§irqfd: Event
§gsi: u32
§device_id: DeviceId
§queue_id: usize
§device_name: String
§

AddMsiRoute

Add one msi route entry into the IRQ chip.

Fields

§gsi: u32
§msi_address: u64
§msi_data: u32
§

ReleaseOneIrq

Fields

§gsi: u32
§irqfd: Event

Implementations§

Source§

impl VmIrqRequest

Source

pub fn execute<F>( &self, set_up_irq: F, sys_allocator: &mut SystemAllocator, ) -> VmIrqResponse
where F: FnOnce(IrqSetup<'_>) -> Result<()>,

Executes this request on the given Vm.

§Arguments
  • set_up_irq - A function that applies an IrqSetup to an IRQ chip.

This does not return a result, instead encapsulating the success or failure in a VmIrqResponse with the intended purpose of sending the response back over the socket that received this VmIrqResponse.

Trait Implementations§

Source§

impl Debug for VmIrqRequest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for VmIrqRequest

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for VmIrqRequest

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,