RustInQemu
For the old RustInQemu page, see RustInQemu/2022
Active effort
- Current state
- Documentation
- Past updates: January 2025 | November 2024
Past efforts
[RFC v3 00/32] Rust binding for QAPI and qemu-ga QMP handler examples
on patchew on loreSubject: [RFC 0/6] scripts: Rewrite simpletrace printer in Rust
Date: Mon, 27 May 2024 16:14:15 +0800
RFC v1
Work in progress
Paolo
- Waiting for Meson 1.8.1: "objects:", rustdoc,
- Later: pinned_init... maybe use MaybeUninit as a first step?
Manos
Zhao
Kevin
- Executing async code, block driver implementations
Bugs
- Add BQL abstraction for tests - avoid running them with "--test-threads 1"
- Distros would prefer to link libstd dynamically; Rust-enabled QEMU binaries are huge
Possible project targets
Nice things to have
- Remove need for manual "meson subprojects update --reset" when updating packagefiles/
- Improve tool integration
- Run code checks a la "meson test --suite codecheck"? (clippy and rustfmt)
- Place rustdoc output for master somewhere?
- split qemu_api into multiple crates
- distros need dynamically linked libstd
- rewrite all main()s in Rust and use -C prefer-dynamic?
- or should Meson be able to link C programs with rlibs?
New code to write
- more QOM procedural macros
- generate qdev properties
- generate parts of TypeInfo?
- monomorphization of T: IsA<Class> to &T (like the momo crate)
- feature parity for pl011
- safe object creation with pinned_init, originating from Linux)
- Generic Rust<->C interop, Error (https://github.com/bonzini/rust-qemu)
- DMA (investigate vm-memory?)
- Trace/log (Summer of Code)
Improved clippy coverage in CI?
- run clippy as part of "make check"
- add to CI a fallible job that runs on nightly clippy with -Dclippy::complexity -Dclippy::perf -Dclippy::suspicious -Dclippy::style -Dunknown_lints. the job should generally pass, and if a new lint triggers it probably should be added to Cargo.toml as either "allow" (rare) or "deny" (possibly after adding #[allow()] to the source).
Miscellanea
qemu-bridge-helper.c
Re-write SUID C executable with useful features.
Bindings
- visitors/QOM properties, could be interesting for
hw/sensor/tmp105.c
... - complete vmstate bindings (needs const_refs_static in Rust 1.83.0, Zhao+Paolo have a prototype)
Devices
hw/block/pflash_cfi01.c
,hw/block/pflash_cfi02.c
(claimed, WIP)- needs block bindings
hw/timer/i8254.c
(claimed, WIP)hw/mem/nvdimm.c
(suggested by Manos)