Struct disk::qcow::QcowFileInner

source ·
struct QcowFileInner {
    raw_file: QcowRawFile,
    header: QcowHeader,
    l1_table: VecCache<u64>,
    l2_entries: u64,
    l2_cache: CacheMap<VecCache<u64>>,
    refcounts: RefCount,
    current_offset: u64,
    unref_clusters: Vec<u64>,
    avail_clusters: Vec<u64>,
    backing_file: Option<Box<dyn DiskFile>>,
}

Fields§

§raw_file: QcowRawFile§header: QcowHeader§l1_table: VecCache<u64>§l2_entries: u64§l2_cache: CacheMap<VecCache<u64>>§refcounts: RefCount§current_offset: u64§unref_clusters: Vec<u64>§avail_clusters: Vec<u64>§backing_file: Option<Box<dyn DiskFile>>

Implementations§

source§

impl QcowFileInner

source

fn find_avail_clusters(&mut self) -> Result<(), Error>

source

fn rebuild_refcounts( raw_file: &mut QcowRawFile, header: QcowHeader ) -> Result<(), Error>

Rebuild the reference count tables.

source

fn limit_range_file(&self, address: u64, count: usize) -> usize

source

fn limit_range_cluster(&self, address: u64, count: usize) -> usize

source

fn virtual_size(&self) -> u64

source

fn l1_address_offset(&self, address: u64) -> u64

source

fn l1_table_index(&self, address: u64) -> u64

source

fn l2_table_index(&self, address: u64) -> u64

source

fn file_offset_read(&mut self, address: u64) -> Result<Option<u64>>

source

fn file_offset_write(&mut self, address: u64) -> Result<u64>

source

fn update_cluster_addr( &mut self, l1_index: usize, l2_index: usize, cluster_addr: u64, set_refcounts: &mut Vec<(u64, u16)> ) -> Result<()>

source

fn get_new_cluster(&mut self, initial_data: Option<Vec<u8>>) -> Result<u64>

source

fn append_data_cluster(&mut self, initial_data: Option<Vec<u8>>) -> Result<u64>

source

fn deallocate_cluster(&mut self, address: u64) -> Result<()>

source

fn zero_bytes(&mut self, address: u64, length: usize) -> Result<()>

source

fn read_l2_cluster( raw_file: &mut QcowRawFile, cluster_addr: u64 ) -> Result<Vec<u64>>

source

fn set_cluster_refcount( &mut self, address: u64, refcount: u16 ) -> Result<Vec<u64>>

source

fn sync_caches(&mut self) -> Result<()>

source

fn read_cb<F>(&mut self, address: u64, count: usize, cb: F) -> Result<usize>
where F: FnMut(Option<&mut dyn DiskFile>, usize, u64, usize) -> Result<()>,

source

fn write_cb<F>(&mut self, address: u64, count: usize, cb: F) -> Result<usize>
where F: FnMut(&mut File, usize, u64, usize) -> Result<()>,

Trait Implementations§

source§

impl Debug for QcowFileInner

source§

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

Formats the value using the given formatter. Read more

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.