qemu/rust/qemu-api
Paolo Bonzini c596199f63 rust: cell: add BQL-enforcing RefCell variant
Similar to the existing BqlCell, introduce a custom interior mutability
primitive that resembles RefCell but accounts for QEMU's threading model.
Borrowing the RefCell requires proving that the BQL is held, and
attempting to access without the BQL is a runtime panic.

Almost all of the code was taken from Rust's standard library, while
removing unstable features and probably-unnecessary functionality that
amounts to 60% of the original code.  A lot of what's left is documentation,
as well as unit tests in the form of doctests.  These are not yet integrated
in "make check" but can be run with "cargo test --doc".

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-12-10 18:49:26 +01:00
..
src rust: cell: add BQL-enforcing RefCell variant 2024-12-10 18:49:26 +01:00
tests rust: fix a couple style issues from clippy 2024-12-10 18:44:06 +01:00
.gitignore rust: allow using build-root bindings.rs from cargo 2024-12-10 18:44:06 +01:00
build.rs rust: build: add "make clippy", "make rustfmt", "make rustdoc" 2024-12-10 18:44:06 +01:00
Cargo.toml rust: cell: add BQL-enforcing RefCell variant 2024-12-10 18:49:26 +01:00
meson.build rust: cell: add BQL-enforcing RefCell variant 2024-12-10 18:49:26 +01:00
README.md rust: build: add "make clippy", "make rustfmt", "make rustdoc" 2024-12-10 18:44:06 +01:00

QEMU bindings and API wrappers

This library exports helper Rust types, Rust macros and C FFI bindings for internal QEMU APIs.

The C bindings can be generated with bindgen, using this build target:

$ make bindings.inc.rs

Generate Rust documentation

Common Cargo tasks can be performed from the QEMU build directory

$ make clippy
$ make rustfmt
$ make rustdoc