mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
scsi: assert that callbacks run in the correct AioContext
Since the removal of AioContext locking, the correctness of the code relies on running requests from a single AioContext at any given time. Add assertions that verify that callbacks are invoked in the correct AioContext. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-ID: <20231205182011.1976568-3-stefanha@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
ed18b1ed4f
commit
10bcb0d996
2 changed files with 17 additions and 0 deletions
|
@ -119,6 +119,9 @@ static void dma_blk_cb(void *opaque, int ret)
|
|||
|
||||
trace_dma_blk_cb(dbs, ret);
|
||||
|
||||
/* DMAAIOCB is not thread-safe and must be accessed only from dbs->ctx */
|
||||
assert(ctx == qemu_get_current_aio_context());
|
||||
|
||||
dbs->acb = NULL;
|
||||
dbs->offset += dbs->iov.size;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue