mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
virtio-scsi: protect events_dropped field
The block layer can invoke the resize callback from any AioContext that is processing requests. The virtqueue is already protected but the events_dropped field also needs to be protected against races. Cover it using the event virtqueue lock because it is closely associated with accesses to the virtqueue. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Message-ID: <20250311132616.1049687-7-stefanha@redhat.com> Tested-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
b348ca2e04
commit
7d8ab5b2f7
2 changed files with 22 additions and 10 deletions
|
@ -82,10 +82,11 @@ struct VirtIOSCSI {
|
|||
|
||||
SCSIBus bus;
|
||||
int resetting; /* written from main loop thread, read from any thread */
|
||||
|
||||
QemuMutex event_lock; /* protects event_vq and events_dropped */
|
||||
bool events_dropped;
|
||||
|
||||
QemuMutex ctrl_lock; /* protects ctrl_vq */
|
||||
QemuMutex event_lock; /* protects event_vq */
|
||||
|
||||
/*
|
||||
* TMFs deferred to main loop BH. These fields are protected by
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue