Skip to main content

Module qcow2

Module qcow2 

Source
Expand description

Pure-Rust qcow2 metadata parser for format-aware replication optimization. Pure-Rust qcow2 metadata parser for format-aware replication optimization.

Provides:

  • File detection via magic bytes (0x514649fb)
  • Header parsing (cluster size, backing file, virtual size)
  • Persistent dirty bitmap parsing for delta replication

All operations are read-only – foxingd never modifies qcow2 metadata. All integers in qcow2 are big-endian.

Structs§

BitmapInfo
Information about a persistent dirty bitmap.
Qcow2Info
Parsed qcow2 header metadata.

Functions§

detect
Detect whether a file is a qcow2 image by reading the header. Returns Ok(None) for non-qcow2 files (magic/version mismatch – expected for most files). Returns Err for genuine I/O or parse failures.
list_bitmaps
List all persistent bitmaps in a qcow2 image.
read_dirty_bitmap
Read a specific dirty bitmap and return the list of dirty regions. Returns dirty regions as Vec<DirtyRange> compatible with copy_delta().