summary refs log tree commit diff stats
path: root/scripts/qapi/schema.py
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2023-03-07 16:04:27 -0500
committerKevin Wolf <kwolf@redhat.com>2023-04-25 13:15:21 +0200
commit407ae2ae0714be309808a10997c248521b184006 (patch)
tree6e5effd2368668a246e01908c41760b856d2d251 /scripts/qapi/schema.py
parentef80ec5067d7ca5b46e5b88be1be33cddfd33551 (diff)
downloadfocaccia-qemu-407ae2ae0714be309808a10997c248521b184006.tar.gz
focaccia-qemu-407ae2ae0714be309808a10997c248521b184006.zip
block: protect BlockBackend->queued_requests with a lock
The CoQueue API offers thread-safety via the lock argument that
qemu_co_queue_wait() and qemu_co_enter_next() take. BlockBackend
currently does not make use of the lock argument. This means that
multiple threads submitting I/O requests can corrupt the CoQueue's
QSIMPLEQ.

Add a QemuMutex and pass it to CoQueue APIs so that the queue is
protected. While we're at it, also assert that the queue is empty when
the BlockBackend is deleted.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Hanna Czenczek <hreitz@redhat.com>
Message-Id: <20230307210427.269214-4-stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'scripts/qapi/schema.py')
0 files changed, 0 insertions, 0 deletions