diff options
Diffstat (limited to 'stubs')
-rw-r--r-- | stubs/iothread-lock-block.c | 8 | ||||
-rw-r--r-- | stubs/meson.build | 3 |
2 files changed, 11 insertions, 0 deletions
diff --git a/stubs/iothread-lock-block.c b/stubs/iothread-lock-block.c new file mode 100644 index 0000000000..c88ed70462 --- /dev/null +++ b/stubs/iothread-lock-block.c @@ -0,0 +1,8 @@ +#include "qemu/osdep.h" +#include "qemu/main-loop.h" + +bool qemu_in_main_thread(void) +{ + return qemu_get_current_aio_context() == qemu_get_aio_context(); +} + diff --git a/stubs/meson.build b/stubs/meson.build index d359cbe1ad..6f80fec761 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -17,6 +17,9 @@ if linux_io_uring.found() stub_ss.add(files('io_uring.c')) endif stub_ss.add(files('iothread-lock.c')) +if have_block + stub_ss.add(files('iothread-lock-block.c')) +endif stub_ss.add(files('isa-bus.c')) stub_ss.add(files('is-daemonized.c')) if libaio.found() |