diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2022-12-16 12:48:16 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2023-04-20 11:17:35 +0200 |
commit | 394b9407e4c515f96df6647d629ee28cbb86f07c (patch) | |
tree | 586b944f5e1f8c339a2b3b735082fe5e28009ab5 /include | |
parent | 1dd91b22a620616cad08bee7efc29280121ff0da (diff) | |
download | qemu-394b9407e4c515f96df6647d629ee28cbb86f07c.zip qemu-394b9407e4c515f96df6647d629ee28cbb86f07c.tar.gz qemu-394b9407e4c515f96df6647d629ee28cbb86f07c.tar.bz2 |
migration: mark mixed functions that can suspend
There should be no paths from a coroutine_fn to aio_poll, however in
practice coroutine_mixed_fn will call aio_poll in the !qemu_in_coroutine()
path. By marking mixed functions, we can track accurately the call paths
that execute entirely in coroutine context, and find more missing
coroutine_fn markers. This results in more accurate checks that
coroutine code does not end up blocking.
If the marking were extended transitively to all functions that call
these ones, static analysis could be done much more efficiently.
However, this is a start and makes it possible to use vrc's path-based
searches to find potential bugs where coroutine_fns call blocking functions.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/migration/qemu-file-types.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/migration/qemu-file-types.h b/include/migration/qemu-file-types.h index 2867e3d..1436f9c 100644 --- a/include/migration/qemu-file-types.h +++ b/include/migration/qemu-file-types.h @@ -35,7 +35,7 @@ void qemu_put_byte(QEMUFile *f, int v); void qemu_put_be16(QEMUFile *f, unsigned int v); void qemu_put_be32(QEMUFile *f, unsigned int v); void qemu_put_be64(QEMUFile *f, uint64_t v); -size_t qemu_get_buffer(QEMUFile *f, uint8_t *buf, size_t size); +size_t coroutine_mixed_fn qemu_get_buffer(QEMUFile *f, uint8_t *buf, size_t size); int qemu_get_byte(QEMUFile *f); @@ -161,7 +161,7 @@ static inline void qemu_get_sbe64s(QEMUFile *f, int64_t *pv) qemu_get_be64s(f, (uint64_t *)pv); } -size_t qemu_get_counted_string(QEMUFile *f, char buf[256]); +size_t coroutine_mixed_fn qemu_get_counted_string(QEMUFile *f, char buf[256]); void qemu_put_counted_string(QEMUFile *f, const char *name); |