bql: add a "mock" BQL for Rust unit tests

Right now, the stub BQL in stubs/iothread-lock.c always reports itself as
unlocked.  However, Rust would like to run its tests in an environment where
the BQL *is* locked.  Provide an extremely dirty function that flips the
return value of bql_is_locked() to true.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2024-11-15 12:08:43 +01:00
parent 716d89f9cc
commit d4873c5d4f
5 changed files with 45 additions and 5 deletions

View file

@ -60,7 +60,7 @@ test('rust-qemu-api-integration',
dependencies: [qemu_api, qemu_api_macros],
link_whole: [rust_qemu_api_objs, libqemuutil]),
args: [
'--test',
'--test', '--test-threads', '1',
'--format', 'pretty',
],
protocol: 'rust',