QEMU-PLUGIN
High level idiomatic Rust bindings to the QEMU Plugin API, including tools to build QEMU plugins in Rust.
Example
Below is a minimal plugin example for a plugin which prints the execution trace of the
program running in QEMU. Notice that all we do is register a struct which implements
Plugin
in a library constructor, and the library takes care of the rest.
use Result;
use ctor;
use ;
use Mutex;
The above src/lib.rs
in a Cargo project with the following Cargo.toml
will compile to
libtiny.so
, which can be loaded in QEMU by running qemu-system-ARCH -plugin ./libtiny.so
.
[]
= "tiny"
= "0.1.0"
= "2021"
[]
= ["cdylib"]
[]
= "8.2.2-v0"
= "1.0.75"
= "0.1.0"
= "0.2.6"