Struct qcow::QcowHeader [−][src]
pub struct QcowHeader {
pub version: u32,
pub backing_file: Option<String>,
pub cluster_bits: u32,
pub size: u64,
pub crypt_method: EncryptionMethod,
pub l1_size: u32,
pub l1_table_offset: u64,
pub refcount_table_offset: u64,
pub refcount_table_clusters: u32,
pub v3_header: Option<Version3Header>,
pub extensions: Vec<HeaderExt>,
// some fields omitted
}
Expand description
Top-level header of Qcow format
Fields
version: u32
Version of the QCOW format. Only version 2 or 3 is supported, future formats will throw a parsing error upon being read.
backing_file: Option<String>
Backing file represented as a string, if any.
cluster_bits: u32
Number of bits that are used for addressing an offset within a cluster (1 << cluster_bits is the cluster size). Must not be less than 9 (i.e. 512 byte clusters).
Note: qemu as of today has an implementation limit of 2 MB as the maximum cluster size and won’t be able to open images with larger cluster sizes.
Note: if the image has Extended L2 Entries then cluster_bits must be at least 14 (i.e. 16384 byte clusters).
size: u64
Virtual disk size in bytes.
Note: qemu has an implementation limit of 32 MB as the maximum L1 table size. With a 2 MB cluster size, it is unable to populate a virtual cluster beyond 2 EB (61 bits); with a 512 byte cluster size, it is unable to populate a virtual size larger than 128 GB (37 bits). Meanwhile, L1/L2 table layouts limit an image to no more than 64 PB (56 bits) of populated clusters, and an image may hit other limits first (such as a file system’s maximum size).
crypt_method: EncryptionMethod
Encryption method to use for contents
l1_size: u32
Number of entries in the active L1 table
l1_table_offset: u64
Offset into the image file at which the active L1 table starts. Must be aligned to a cluster boundary.
refcount_table_offset: u64
Offset into the image file at which the refcount table starts. Must be aligned to a cluster boundary.
refcount_table_clusters: u32
Number of clusters that the refcount table occupies
v3_header: Option<Version3Header>
Part of header only present in qcow version 3, otherwise set to None
extensions: Vec<HeaderExt>
Extentions to the header format
Implementations
Get the size of a cluster in bytes from the qcow
Trait Implementations
The type of arguments needed to be supplied in order to read this type, usually a tuple. Read more
fn read_options<R: Read + Seek>(
__binread_generated_var_reader: &mut R,
__binread_generated_var_options: &ReadOptions,
__binread_generated_var_arguments: Self::Args
) -> BinResult<Self>
fn read_options<R: Read + Seek>(
__binread_generated_var_reader: &mut R,
__binread_generated_var_options: &ReadOptions,
__binread_generated_var_arguments: Self::Args
) -> BinResult<Self>
Read the type from the reader
Read the type from the reader while assuming no arguments have been passed Read more
Read the type from the reader using the specified arguments