pub struct PciHotPlugManager {
    ports: HashMap<u8, PortStub>,
    jail_warden: Box<dyn JailWarden>,
    rootbus_controller: Option<Sender<PciRootCommand>>,
}
Expand description

PciHotPlugManager manages hotplug ports, and handles PCI device hot plug and hot removal.

Fields§

§ports: HashMap<u8, PortStub>

map of downstream bus number to corresponding PortStub

§jail_warden: Box<dyn JailWarden>

JailWarden for jailing hotplug devices

§rootbus_controller: Option<Sender<PciRootCommand>>

control channel to root bus

Implementations§

Constructs PciHotPlugManager.

Constructor uses forking, therefore has to be called early, before crosvm enters a multi-threaded context.

Set root bus controller. Required before any hotplug commands.

rootbus_controller cannot be intialized at PciHotPlugManager::new, which must be called in a single-threaded context. However, rootbus_controller is only available after VM boots, by which time crosvm is multi-threaded.

Adds a hotplug capable port to manage.

PciHotPlugManager assumes exclusive control for adding and removing devices to this port.

hotplugs up to 8 PCI devices as “functions of a device” (in PCI Bus Device Function sense).

returns the bus number of the bus on success.

Removes all hotplugged devices on the hotplug bus.

Find a bus number available for hotplug.

Sends hotplug signal on the port.

Sends eject signal on the port, and removes downstream devices on the port.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
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.
Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.