mirror of
https://github.com/utmapp/qemu.git
synced 2026-05-26 13:51:06 +00:00
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:
@@ -1,11 +1,17 @@
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/main-loop.h"
|
||||
|
||||
static bool bql_is_locked = false;
|
||||
static uint32_t bql_unlock_blocked;
|
||||
|
||||
bool bql_locked(void)
|
||||
{
|
||||
return false;
|
||||
return bql_is_locked;
|
||||
}
|
||||
|
||||
void rust_bql_mock_lock(void)
|
||||
{
|
||||
bql_is_locked = true;
|
||||
}
|
||||
|
||||
void bql_lock_impl(const char *file, int line)
|
||||
|
||||
Reference in New Issue
Block a user