Crates.io | qcow2 |
lib.rs | qcow2 |
version | 0.1.2 |
source | src |
created_at | 2016-07-12 06:51:31.712369 |
updated_at | 2016-07-13 07:47:28.033945 |
description | Reading qcow2 virtual disk images |
homepage | https://github.com/vasi/qcow2-rs |
repository | https://github.com/vasi/qcow2-rs |
max_upload_size | |
id | 5641 |
size | 429,374 |
This crate can parse and read qcow2 virtual disks, as used by qemu and other emulators.
Qcow2 is a flexible format for disk images, that only allocates space as needed. It has many other interesting features.
extern crate positioned_io;
extern crate qcow2;
use positioned_io::ReadAt;
use qcow2::Qcow2;
// Open a qcow2 file.
let file = try!(File::open("image.qcow2"));
let qcow = try!(Qcow2::open(file));
// Read some data from the middle.
let reader = try!(qcow.reader());
let mut buf = vec![0, 4096];
try!(reader.read_exact_at(5 * 1024 * 1024, &mut buf));
http://vasi.github.io/qcow2-rs/qcow2/
This crate works with Cargo and is on
crates.io. Add it to your Cargo.toml
like so:
[dependencies]
qcow2 = "0.1.0"