summary refs log tree commit diff stats
path: root/rust/qemu-api/meson.build
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2024-11-15 12:20:35 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2024-12-10 18:49:26 +0100
commitc596199f639cdf4cc021c9bc076e4a1e64e9d50f (patch)
treeb03baf9bffed81111d5280bbca9eb6ef4dc7c498 /rust/qemu-api/meson.build
parent8e194c0ea5cdbae05b77125a582f9927678121ee (diff)
downloadfocaccia-qemu-c596199f639cdf4cc021c9bc076e4a1e64e9d50f.tar.gz
focaccia-qemu-c596199f639cdf4cc021c9bc076e4a1e64e9d50f.zip
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>
Diffstat (limited to 'rust/qemu-api/meson.build')
-rw-r--r--rust/qemu-api/meson.build3
1 files changed, 3 insertions, 0 deletions
diff --git a/rust/qemu-api/meson.build b/rust/qemu-api/meson.build
index edc21e1a3f..cacb112c5c 100644
--- a/rust/qemu-api/meson.build
+++ b/rust/qemu-api/meson.build
@@ -6,6 +6,9 @@ _qemu_api_cfg = run_command(rustc_args,
 if rustc.version().version_compare('>=1.77.0')
   _qemu_api_cfg += ['--cfg', 'has_offset_of']
 endif
+if get_option('debug_mutex')
+  _qemu_api_cfg += ['--feature', 'debug_cell']
+endif
 
 _qemu_api_rs = static_library(
   'qemu_api',