pub struct NvmeDriver<T: 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<T: DeviceBacking> NvmeDriver<T>
impl<T: DeviceBacking> NvmeDriver<T>
Sourcepub async fn new(
driver_source: &VmTaskDriverSource,
cpu_count: u32,
device: T,
) -> Result<Self>
pub async fn new( driver_source: &VmTaskDriverSource, cpu_count: u32, device: T, ) -> Result<Self>
Initializes the driver.
Sourcepub async fn namespace(&self, nsid: u32) -> Result<Namespace, NamespaceError>
pub async fn namespace(&self, nsid: u32) -> Result<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 restore(
driver_source: &VmTaskDriverSource,
cpu_count: u32,
device: T,
saved_state: &NvmeDriverSavedState,
) -> Result<Self>
pub async fn restore( driver_source: &VmTaskDriverSource, cpu_count: u32, device: T, saved_state: &NvmeDriverSavedState, ) -> 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.
Trait Implementations§
Source§impl<T: DeviceBacking> Drop for NvmeDriver<T>
impl<T: DeviceBacking> Drop for NvmeDriver<T>
Source§impl<T: DeviceBacking> Inspect for NvmeDriver<T>
impl<T: DeviceBacking> Inspect for NvmeDriver<T>
Auto Trait Implementations§
impl<T> Freeze for NvmeDriver<T>
impl<T> !RefUnwindSafe for NvmeDriver<T>
impl<T> Send for NvmeDriver<T>
impl<T> Sync for NvmeDriver<T>where
T: Sync,
impl<T> Unpin for NvmeDriver<T>
impl<T> !UnwindSafe for NvmeDriver<T>
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