diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2022-04-14 19:57:52 +0200 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2022-04-26 13:16:37 -0500 |
commit | ee19d953ecff53908a645d38a1b913fdf15a72f4 (patch) | |
tree | e85205cb70e809688b4c694a0c497a33891642a9 /migration | |
parent | 8610b4491f02312f3bf0de10826fad7aa99ddfcf (diff) | |
download | qemu-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 'migration')
0 files changed, 0 insertions, 0 deletions