disk_get_vmgs

Struct GetVmgsDisk

Source
pub struct GetVmgsDisk { /* private fields */ }
Expand description

An implementation of [DiskIo] backed by the GET.

Implementations§

Source§

impl GetVmgsDisk

Source

pub async fn new( get: GuestEmulationTransportClient, ) -> Result<Self, NewGetVmgsDiskError>

Returns a new disk instance, communicating read and write IOs over the get transport.

Source

pub fn restore_with_meta( get: GuestEmulationTransportClient, meta: SavedBlockStorageMetadata, ) -> Result<Self, NewGetVmgsDiskError>

Create a disk using metadata previously-fetched via Self::save_meta.

§Caution

This method does not confirm that the provided meta is what would be provided by get. Callers MUST ensure that the provided meta matches the provided get instance.

Failing to do so may result in data corruption/loss, though, notably: it will not result in any memory-unsafety (hence why the function isn’t marked unsafe).

Source

pub fn save_meta(&self) -> SavedBlockStorageMetadata

Save the metadata for this disk, for use in passing to Self::restore_with_meta

Trait Implementations§

Source§

impl Clone for GetVmgsDisk

Source§

fn clone(&self) -> GetVmgsDisk

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GetVmgsDisk

Source§

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

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

impl DiskIo for GetVmgsDisk

Source§

async fn sync_cache(&self) -> Result<(), DiskError>

Issues an asynchronous flush operation to the disk.

Source§

fn disk_type(&self) -> &str

Returns the disk type name as a string. Read more
Source§

fn sector_count(&self) -> u64

Returns the current sector count. Read more
Source§

fn sector_size(&self) -> u32

Returns the logical sector size of the backing store. Read more
Source§

fn disk_id(&self) -> Option<[u8; 16]>

Optionally returns a 16-byte identifier for the disk, if there is a natural one for this backing store. Read more
Source§

fn physical_sector_size(&self) -> u32

Returns the physical sector size of the backing store. Read more
Source§

fn is_fua_respected(&self) -> bool

Returns true if the fua parameter to [DiskIo::write_vectored] is respected by the backing store by ensuring that the IO is immediately committed to disk.
Source§

fn is_read_only(&self) -> bool

Returns true if the disk is read only.
Source§

async fn read_vectored( &self, buffers: &RequestBuffers<'_>, sector: u64, ) -> Result<(), DiskError>

Issues an asynchronous read-scatter operation to the disk. Read more
Source§

async fn write_vectored( &self, buffers: &RequestBuffers<'_>, sector: u64, _fua: bool, ) -> Result<(), DiskError>

Issues an asynchronous write-gather operation to the disk. Read more
Source§

async fn unmap( &self, _sector: u64, _count: u64, _block_level_only: bool, ) -> Result<(), DiskError>

Unmap sectors from the layer.
Source§

fn unmap_behavior(&self) -> UnmapBehavior

Returns the behavior of the unmap operation.
§

fn optimal_unmap_sectors(&self) -> u32

Returns the optimal granularity for unmaps, in sectors.
§

fn pr(&self) -> Option<&dyn PersistentReservation>

Optionally returns a trait object to issue persistent reservation requests.
§

fn eject(&self) -> impl Future<Output = Result<(), DiskError>> + Send

Issues an asynchronous eject media operation to the disk.
§

fn wait_resize(&self, sector_count: u64) -> impl Future<Output = u64> + Send

Waits for the disk sector size to be different than the specified value.
Source§

impl Inspect for GetVmgsDisk

Source§

fn inspect(&self, req: Request<'_>)

Inspects the object.

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

impl<T> IntoAny for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts into a Box<dyn Any>.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more