struct V2Header {Show 13 fields
magic: u32,
version: u32,
backing_file_offset: u64,
backing_file_size: u32,
cluster_bits: u32,
size: AtomicU64,
crypt_method: u32,
l1_size: AtomicU32,
l1_table_offset: AtomicU64,
refcount_table_offset: AtomicU64,
refcount_table_clusters: AtomicU32,
nb_snapshots: u32,
snapshots_offset: u64,
}
Expand description
Qcow2 v2 header.
Fields§
§magic: u32
Qcow magic string (“QFI\xfb”).
version: u32
Version number (valid values are 2 and 3).
backing_file_offset: u64
Offset into the image file at which the backing file name is stored (NB: The string is not null terminated). 0 if the image doesn’t have a backing file.
Note: backing files are incompatible with raw external data files (auto-clear feature bit 1).
backing_file_size: u32
Length of the backing file name in bytes. Must not be longer than 1023 bytes. Undefined if the image doesn’t have a backing file.
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: AtomicU64
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: u32
Encryption method:
- no encryption
- AES encryption
- LUKS encryption
l1_size: AtomicU32
Number of entries in the active L1 table.
l1_table_offset: AtomicU64
Offset into the image file at which the active L1 table starts. Must be aligned to a cluster boundary.
refcount_table_offset: AtomicU64
Offset into the image file at which the refcount table starts. Must be aligned to a cluster boundary.
refcount_table_clusters: AtomicU32
Number of clusters that the refcount table occupies.
nb_snapshots: u32
Number of snapshots contained in the image.
snapshots_offset: u64
Offset into the image file at which the snapshot table starts. Must be aligned to a cluster boundary.