Crates.io | qcow |
lib.rs | qcow |
version | 1.2.0 |
source | src |
created_at | 2021-08-27 18:29:28.620533 |
updated_at | 2021-10-06 20:57:47.329367 |
description | A library for working with QEMU qcow images |
homepage | https://panda.re |
repository | https://github.com/panda-re/qcow-rs |
max_upload_size | |
id | 443203 |
size | 53,464 |
A Rust library for working with qcow images.
// open qcow
let qcow = qcow::open(PATH).unwrap();
// print out list of snapshots in the qcow
for snapshot in qcow.snapshots() {
println!(
"Snapshot {:?}: {:?} (size = {})",
snapshot.unique_id,
snapshot.name,
snapshot.vm_state_size
);
}
// create a reader for accessing the virtual hard disk
let mut file = BufReader::new(File::open(PATH)?);
let qcow2 = qcow.unwrap_qcow2();
let mut reader = qcow2.reader(&mut file);
// read the first 10 bytes of the virtual hard disk
let mut buf = [0; 10];
reader.read_exact(&mut buf)?;
Also present is a cli for interfacing with qcows.
qcow-cli 0.1.0
A utility for querying information about qcow files
USAGE:
qcow <qcow> <SUBCOMMAND>
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
ARGS:
<qcow>
SUBCOMMANDS:
get-file Output a file within the qcow to stdout
help Prints this message or the help of the given subcommand(s)
info Output info about the given qcow
partitions Display a list of partitions in the qcow image
tree Display a tree listing of the contents of the qcow
cargo install qcow-cli
Listing info about the qcow:
Viewing the file tree:
Viewing the image partitions:
Extracting or viewing a file using get-file: