Enum devices::ResourceCarrier
source · pub enum ResourceCarrier {
VirtioNet(NetResourceCarrier),
}
Expand description
A ResourceCarrier moves resources for PCI device across process boundary.
ResourceCarrier can be sent across processes using De/Serialize. All the variants shall be able to convert into a HotPlugPluggable device.
Variants§
VirtioNet(NetResourceCarrier)
virtio-net device.
Implementations§
source§impl ResourceCarrier
impl ResourceCarrier
sourcepub fn debug_label(&self) -> String
pub fn debug_label(&self) -> String
Returns debug label for the target device.
sourcepub fn keep_rds(&self) -> Vec<RawDescriptor>
pub fn keep_rds(&self) -> Vec<RawDescriptor>
A vector of device-specific file descriptors that must be kept open after jailing. Must be called before the process is jailed.
sourcepub fn allocate_address(
&mut self,
preferred_address: PciAddress,
resources: &mut SystemAllocator
) -> Result<(), PciDeviceError>
pub fn allocate_address( &mut self, preferred_address: PciAddress, resources: &mut SystemAllocator ) -> Result<(), PciDeviceError>
Allocate the preferred address to the device.
sourcepub fn assign_irq(
&mut self,
irq_evt: IrqLevelEvent,
pin: PciInterruptPin,
irq_num: u32
)
pub fn assign_irq( &mut self, irq_evt: IrqLevelEvent, pin: PciInterruptPin, irq_num: u32 )
Assign a legacy PCI IRQ to this device.
The device may write to irq_evt
to trigger an interrupt.
When irq_resample_evt
is signaled, the device should re-assert irq_evt
if necessary.
Trait Implementations§
source§impl<'de> Deserialize<'de> for ResourceCarrier
impl<'de> Deserialize<'de> for ResourceCarrier
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl RefUnwindSafe for ResourceCarrier
impl Send for ResourceCarrier
impl Sync for ResourceCarrier
impl Unpin for ResourceCarrier
impl UnwindSafe for ResourceCarrier
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
Mutably borrows from an owned value. Read more
§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>
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>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
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)
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.