#qemu #disk #image

bin+lib qcow2

Reading qcow2 virtual disk images

3 releases

Uses old Rust 2015

0.1.2 Jul 13, 2016
0.1.1 Jul 12, 2016
0.1.0 Jul 12, 2016

#1397 in Filesystem

Download history 13/week @ 2023-10-15 11/week @ 2023-10-22 19/week @ 2023-10-29 13/week @ 2023-11-05 12/week @ 2023-11-12 17/week @ 2023-11-19 23/week @ 2023-11-26 17/week @ 2023-12-03 14/week @ 2023-12-10 10/week @ 2023-12-17 19/week @ 2023-12-24 7/week @ 2023-12-31 11/week @ 2024-01-07 10/week @ 2024-01-14 13/week @ 2024-01-21 16/week @ 2024-01-28

51 downloads per month
Used in qcow2-fuse

MIT license

34KB
797 lines

qcow2

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.

Build Status Crates.io

Example

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));

Documentation

http://vasi.github.io/qcow2-rs/qcow2/

Usage

This crate works with Cargo and is on crates.io. Add it to your Cargo.toml like so:

[dependencies]
qcow2 = "0.1.0"

Dependencies

~775KB