This series introduces a static analyzer for QEMU. It consists of a
single static-analyzer.py script that relies on libclang's Python
bindings, and provides a common framework on which arbitrary static
analysis checks can be developed and run against QEMU's code base.
Summary of the series:
- P
Add a static-analyzer.py script that uses libclang's Python bindings to
provide a common framework on which arbitrary static analysis checks can
be developed and run against QEMU's code base.
As an example, a simple check is included that verifies that the return
value of static, non-void function
Make some non-void static functions whose return values are ignored by
all callers return void instead.
These functions were found by the shiny new static-analyzer.py. Only a
few of the reported cases were fixed.
Signed-off-by: Alberto Faria
---
block/file-posix.c | 6 +-
block/io.c
These problems were found by static-analyzer.py. Only a few of the
reported cases were fixed.
Signed-off-by: Alberto Faria
---
block/block-backend.c | 13 -
block/copy-before-write.c | 3 ++-
block/dirty-bitmap.c | 6 --
block/iscsi.c | 3 ++-
block/qcow2.
Add a static-analyzer.py check ensuring that non-coroutine_fn functions
don't perform direct calls to coroutine_fn functions.
For the few cases where this must happen, introduce an
__allow_coroutine_fn_call() macro that wraps offending calls and
overrides the static analyzer.
Signed-off-by: Alber
These calls were found by static-analyzer.py.
Signed-off-by: Alberto Faria
---
block/block-backend.c | 2 +-
block/io.c | 10 +-
block/parallels.c | 4 ++--
block/qcow2-refcount.c | 2 +-
block/qed-table.c | 2 +-
block/qed.c| 2 +-
block/vmdk.c
These problems were found by static-analyzer.py. Only a few of the
reported cases were fixed.
Signed-off-by: Alberto Faria
---
include/block/block_int-common.h | 12 +---
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/include/block/block_int-common.h b/include/block/block_
Extend static-analyzer.py to enforce coroutine_fn restrictions on
function pointer operations.
Invalid operations include assigning a coroutine_fn value to a
non-coroutine_fn function pointer, and invoking a coroutine_fn function
pointer from a non-coroutine_fn function.
Signed-off-by: Alberto Fa
When applied to a function, it advertises that it should not be called
from coroutine_fn functions.
Make generated_co_wrapper evaluate to no_coroutine_fn, as coroutine_fn
functions should instead directly call the coroutine_fn that backs the
generated_co_wrapper.
Extend static-analyzer.py's "coro
On 6/23/22 22:20, Alberto Faria wrote:
On Thu, Jun 9, 2022 at 4:27 PM Alberto Faria wrote:
Start by making the interfaces of analogous non-coroutine and coroutine
functions consistent with each other, then implement the non-coroutine
ones using generated_co_wrapper.
For the bdrv_pwrite_sync()
On 5/17/22 13:35, Alberto Faria wrote:
Adjust existing pairs of non-coroutine and coroutine functions to share
the same calling convention, and add non-coroutine/coroutine
counterparts where they don't exist.
Also make the non-coroutine versions generated_co_wrappers.
This series sits on top of
On 7/2/22 13:33, Alberto Faria wrote:
@@ -1537,8 +1537,9 @@ static void blk_aio_read_entry(void *opaque)
QEMUIOVector *qiov = rwco->iobuf;
assert(qiov->size == acb->bytes);
-rwco->ret = blk_co_do_preadv(rwco->blk, rwco->offset, acb->bytes,
- qio
On 7/2/22 13:33, Alberto Faria wrote:
The current primary motivation for this work is enforcing rules around
block layer coroutines, which is why most of the series focuses on that.
However, the static analyzer is intended to be sufficiently generic to
satisfy other present and future QEMU static
13 matches
Mail list logo