RustInQemu
For the old RustInQemu page, see RustInQemu/2022
Active effort
- Current state
- Documentation
- Past updates: April 2025 | 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 RustDate: Mon, 27 May 2024 16:14:15 +0800
RFC v1
Work in progress
To be merged
- let Meson handle mixed-language linking of Rust and C objects: avoids staticlib hack, and optionally enables usage of dynamic Rust libstd [waiting for Meson 1.9.2]
- Marc-André: extend CI to more targets [waiting for Meson bugfixes]
Submitted
- QObject bindings (Paolo/Marc-André)
Paolo
- Improving Cargo support in Meson
Manos
- ...
Zhao
- BQL-free HPET
- vm-memory integration
Kevin
- Executing async code, block driver implementations
Stefan
- Support for dtrace tracing backend
Martin
- Adding support for safer object initialization using pinned-init
Bugs
- Add BQL abstraction for tests - avoid running them with "--test-threads 1"
Ideas
Check if distros package the dependent Rust crates
Mostly useful for distros to enable Rust when building QEMU.
- Missing in Fedora: arbitrary-int, bilge, bilge-impl, foreign
- Fedora does have bitfield-struct, which is a bit inferior to bilge in some respects but smaller
- Debian?
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?
- Or generate with sphinx, with something like sphinx-rust
- More bindings: I2C?
New code to write
- more QOM procedural macros
- generate parts of TypeInfo?
- monomorphization of T: IsA<Class> to &T (like the momo crate)
- safe object creation with pinned_init, originating from Linux)
- Character device flow control
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.cRe-write SUID C executable with useful features.
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)