qemu-fw-cfg-rs

Crates.io License-MIT License-Apache docs.rs

A Rust library for reading fw_cfg from QEMU.

Usage

Add the following to your Cargo.toml:

toml [dependencies] qemu-fw-cfg = "0.1"

To use qemu-fw-cfg without alloc, you can use this instead:

toml [dependencies] qemu-fw-cfg = { version = "0.1", default-features = false }

Examples

```rust use qemufwcfg::FwCfg;

// Verify that we are inside QEMU. if runninginqemu() { // Create a new FwCfg instance. let fwcfg = unsafe { FwCfg::new().unwrap() }; // Retrieve information of a file. let file = fwcfg.findfile("etc/igd-opregion").unwrap(); // Read data from the file. let data = fwcfg.read_file(&file); } ```

Rust support

Currently, qemu-fw-cfg required nightly compiler to build.

License

This project is licensed under either of Apache License, Version 2.0 or MIT license at your option.