diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2022-04-14 19:57:51 +0200 |
|---|---|---|
| committer | Eric Blake <eblake@redhat.com> | 2022-04-26 13:16:36 -0500 |
| commit | 8610b4491f02312f3bf0de10826fad7aa99ddfcf (patch) | |
| tree | 77efdade695b102859eac3cdbd441183d21e1e7d /include/hw/intc | |
| parent | 172f5f1a4058c361bfcd19317b0e3151556b3edb (diff) | |
| download | focaccia-qemu-8610b4491f02312f3bf0de10826fad7aa99ddfcf.tar.gz focaccia-qemu-8610b4491f02312f3bf0de10826fad7aa99ddfcf.zip | |
nbd: keep send_mutex/free_sema handling outside nbd_co_do_establish_connection
Elevate s->in_flight early so that other incoming requests will wait on the CoQueue in nbd_co_send_request; restart them after getting back from nbd_reconnect_attempt. This could be after the reconnect timer or nbd_cancel_in_flight have cancelled the attempt, so there is no need anymore to cancel the requests there. nbd_co_send_request now handles both stopping and restarting pending requests after a successful connection, and there is no need to hold send_mutex in nbd_co_do_establish_connection. The current setup is confusing because nbd_co_do_establish_connection is called both with send_mutex taken and without it. Before the patch it uses free_sema which (at least in theory...) is protected by send_mutex, after the patch it does not anymore. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20220414175756.671165-5-pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [eblake: wrap long line] Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@openvz.org> Reviewed-by: Lukas Straub <lukasstraub2@web.de> Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'include/hw/intc')
0 files changed, 0 insertions, 0 deletions