pub struct NvmeDriver<D: DeviceBacking> { /* private fields */ }Expand description
An NVMe driver.
Note that if this is dropped, the process will abort. Call
NvmeDriver::shutdown to drop this.
Further, note that this is an internal interface to be used
only by NvmeDisk! Remove any sanitization in fuzz_nvm_driver.rs
if this struct is used anywhere else.
Implementations§
Source§impl<D: DeviceBacking> NvmeDriver<D>
impl<D: DeviceBacking> NvmeDriver<D>
Sourcepub async fn new(
driver_source: &VmTaskDriverSource,
cpu_count: u32,
device: D,
bounce_buffer: bool,
) -> Result<Self>
pub async fn new( driver_source: &VmTaskDriverSource, cpu_count: u32, device: D, bounce_buffer: bool, ) -> Result<Self>
Initializes the driver.
Sourcepub async fn namespace(
&mut self,
nsid: u32,
) -> Result<Arc<Namespace>, NamespaceError>
pub async fn namespace( &mut self, nsid: u32, ) -> Result<Arc<Namespace>, NamespaceError>
Gets the namespace with namespace ID nsid.
Sourcepub fn fallback_cpu_count(&self) -> usize
pub fn fallback_cpu_count(&self) -> usize
Returns the number of CPUs that are in fallback mode (that are using a remote CPU’s queue due to a failure or resource limitation).
Sourcepub async fn save(&mut self) -> Result<NvmeDriverSavedState>
pub async fn save(&mut self) -> Result<NvmeDriverSavedState>
Saves the NVMe driver state during servicing.
Sourcepub async fn clear_existing_state(
driver_source: &VmTaskDriverSource,
device: D,
) -> Result<()>
pub async fn clear_existing_state( driver_source: &VmTaskDriverSource, device: D, ) -> Result<()>
This should only be called during restore if keepalive is no longer supported and the previously enabled device needs to be reset. It performs a controller reset by setting cc.en to 0. It will then also drop the given device instance.
Sourcepub async fn restore(
driver_source: &VmTaskDriverSource,
cpu_count: u32,
device: D,
saved_state: &NvmeDriverSavedState,
bounce_buffer: bool,
) -> Result<Self>
pub async fn restore( driver_source: &VmTaskDriverSource, cpu_count: u32, device: D, saved_state: &NvmeDriverSavedState, bounce_buffer: bool, ) -> Result<Self>
Restores NVMe driver state after servicing.
Sourcepub fn update_servicing_flags(&mut self, nvme_keepalive: bool)
pub fn update_servicing_flags(&mut self, nvme_keepalive: bool)
Change device’s behavior when servicing.