The QEMU processor emulator that plays an important role in the open-source Linux virtualization stack has been seeing experimental support for the Rust programming language developing within its codebase. There continues to be good progress being made on this Rust support as more QEMU components get ported over to this programming language for memory safety and other security benefits.
Paolo Bonzini of Red Hat issued an update on Friday around the ongoing Rust usage within QEMU. The Rust support remains experimental for now but there has been improvements made to the Rust bindings and more functionality now possible within the Rust code.
Bonzini summed up the current Rust state in QEMU as:
“Overall, I’d say the progress is good: most of the missing features mentioned in the previous update have been fixed or at least have a plan for the next few months.
…
QEMU when built with “–enable-rust“ compiles on all supported build platforms. It passes CI and “make check-unit“ runs tests for rust/qemu-api. “make check-qtests“ covers the Rust pl011 and HPET device models, including migration of the former. pl011 is entirely implemented using safe code (minus migration and qdev properties). HPET uses unsafe in some small and fairly well confined cases.Since the previous update, some mistakes in the early bindings code have become apparent; in particular, orphan rules made it too hard to implement classes outside the qemu_api crate, and in general to split the qemu_api crate in multiple parts—for example, parts that are of interest to tools and parts that are only used by system emulators. Another important change is the separation between bindgen-generated types and the structs that are actually used by Rust code. This allows traits such as Send, Sync or Zeroable to be specified independently for C and Rust structs.”
Those wanting to learn more about the Rust support in QEMU can see the status update via the QEMU mailing list.