pub struct GetVmgsDisk { /* private fields */ }
Expand description
An implementation of [DiskIo
] backed by the GET.
Implementations§
Source§impl GetVmgsDisk
impl GetVmgsDisk
Sourcepub async fn new(
get: GuestEmulationTransportClient,
) -> Result<Self, NewGetVmgsDiskError>
pub async fn new( get: GuestEmulationTransportClient, ) -> Result<Self, NewGetVmgsDiskError>
Returns a new disk instance, communicating read and write IOs over the
get
transport.
Sourcepub fn restore_with_meta(
get: GuestEmulationTransportClient,
meta: SavedBlockStorageMetadata,
) -> Result<Self, NewGetVmgsDiskError>
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
).
Sourcepub fn save_meta(&self) -> SavedBlockStorageMetadata
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
impl Clone for GetVmgsDisk
Source§fn clone(&self) -> GetVmgsDisk
fn clone(&self) -> GetVmgsDisk
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for GetVmgsDisk
impl Debug for GetVmgsDisk
Source§impl DiskIo for GetVmgsDisk
impl DiskIo for GetVmgsDisk
Source§async fn sync_cache(&self) -> Result<(), DiskError>
async fn sync_cache(&self) -> Result<(), DiskError>
Issues an asynchronous flush operation to the disk.
Source§fn sector_count(&self) -> u64
fn sector_count(&self) -> u64
Returns the current sector count. Read more
Source§fn sector_size(&self) -> u32
fn sector_size(&self) -> u32
Returns the logical sector size of the backing store. Read more
Source§fn disk_id(&self) -> Option<[u8; 16]>
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
fn physical_sector_size(&self) -> u32
Returns the physical sector size of the backing store. Read more
Source§fn is_fua_respected(&self) -> bool
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
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>
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>
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>
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
fn unmap_behavior(&self) -> UnmapBehavior
Returns the behavior of the unmap operation.
§fn optimal_unmap_sectors(&self) -> u32
fn optimal_unmap_sectors(&self) -> u32
Returns the optimal granularity for unmaps, in sectors.
§fn pr(&self) -> Option<&dyn PersistentReservation>
fn pr(&self) -> Option<&dyn PersistentReservation>
Optionally returns a trait object to issue persistent reservation
requests.
Auto Trait Implementations§
impl Freeze for GetVmgsDisk
impl !RefUnwindSafe for GetVmgsDisk
impl Send for GetVmgsDisk
impl Sync for GetVmgsDisk
impl Unpin for GetVmgsDisk
impl !UnwindSafe for GetVmgsDisk
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