aboutsummaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2022-04-14 19:57:52 +0200
committerEric Blake <eblake@redhat.com>2022-04-26 13:16:37 -0500
commitee19d953ecff53908a645d38a1b913fdf15a72f4 (patch)
treee85205cb70e809688b4c694a0c497a33891642a9 /crypto
parent8610b4491f02312f3bf0de10826fad7aa99ddfcf (diff)
downloadqemu-ee19d953ecff53908a645d38a1b913fdf15a72f4.zip
qemu-ee19d953ecff53908a645d38a1b913fdf15a72f4.tar.gz
qemu-ee19d953ecff53908a645d38a1b913fdf15a72f4.tar.bz2
nbd: use a QemuMutex to synchronize yanking, reconnection and coroutines
The condition for waiting on the s->free_sema queue depends on both s->in_flight and s->state. The latter is currently using atomics, but this is quite dubious and probably wrong. Because s->state is written in the main thread too, for example by the yank callback, it cannot be protected by a CoMutex. Introduce a separate lock that can be used by nbd_co_send_request(); later on this lock will also be used for s->state. There will not be any contention on the lock unless there is a yank or reconnect, so this is not performance sensitive. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20220414175756.671165-6-pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Lukas Straub <lukasstraub2@web.de> Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'crypto')
0 files changed, 0 insertions, 0 deletions