summary refs log tree commit diff stats
path: root/rust/qemu-api/src/cell.rs
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2025-04-05 12:05:21 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2025-06-03 22:42:18 +0200
commit18c9f4a1729db1389218983379f6d62a9e550754 (patch)
treefdfa0a1c41db62fa54acc892508eb763b55c5c67 /rust/qemu-api/src/cell.rs
parentf620cadc0c24ae414b46204e57a82f7bf586d2c4 (diff)
downloadfocaccia-qemu-18c9f4a1729db1389218983379f6d62a9e550754.tar.gz
focaccia-qemu-18c9f4a1729db1389218983379f6d62a9e550754.zip
rust: cell: remove support for running doctests with "cargo test --doc"
This is not needed anymore now that tests link with libqemuutil.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to '')
-rw-r--r--rust/qemu-api/src/cell.rs22
1 files changed, 9 insertions, 13 deletions
diff --git a/rust/qemu-api/src/cell.rs b/rust/qemu-api/src/cell.rs
index 05ce09f6cb..27063b049d 100644
--- a/rust/qemu-api/src/cell.rs
+++ b/rust/qemu-api/src/cell.rs
@@ -225,27 +225,23 @@ use crate::bindings;
 
 /// An internal function that is used by doctests.
 pub fn bql_start_test() {
-    if cfg!(MESON) {
-        // SAFETY: integration tests are run with --test-threads=1, while
-        // unit tests and doctests are not multithreaded and do not have
-        // any BQL-protected data.  Just set bql_locked to true.
-        unsafe {
-            bindings::rust_bql_mock_lock();
-        }
+    // SAFETY: integration tests are run with --test-threads=1, while
+    // unit tests and doctests are not multithreaded and do not have
+    // any BQL-protected data.  Just set bql_locked to true.
+    unsafe {
+        bindings::rust_bql_mock_lock();
     }
 }
 
 pub fn bql_locked() -> bool {
     // SAFETY: the function does nothing but return a thread-local bool
-    !cfg!(MESON) || unsafe { bindings::bql_locked() }
+    unsafe { bindings::bql_locked() }
 }
 
 fn bql_block_unlock(increase: bool) {
-    if cfg!(MESON) {
-        // SAFETY: this only adjusts a counter
-        unsafe {
-            bindings::bql_block_unlock(increase);
-        }
+    // SAFETY: this only adjusts a counter
+    unsafe {
+        bindings::bql_block_unlock(increase);
     }
 }