On Tue, Jun 01, 2021 at 07:57:28AM +0200, Sergio Lopez wrote: > Before switching between AioContexts we need to make sure that we're > fully quiesced ("nb_requests == 0" for every client) when entering the > drained section. > > To do this, we set "quiescing = true" for every client on > ".drained_begin" to prevent new coroutines to be created, and check if
s/to be created/from being created/ > "nb_requests == 0" on ".drained_poll". Finally, once we're exiting the > drained section, on ".drained_end" we set "quiescing = false" and > call "nbd_client_receive_next_request()" to resume the processing of > new requests. > > With these changes, "blk_aio_attach()" and "blk_aio_detach()" can be > reverted to be as simple as they were before f148ae7d36. Is that reversion planned to be patch 3 of your series in v2? > > RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1960137 > Suggested-by: Kevin Wolf <kw...@redhat.com> > Signed-off-by: Sergio Lopez <s...@redhat.com> > --- > nbd/server.c | 99 +++++++++++++++++++++++++++++++++++++++------------- > 1 file changed, 75 insertions(+), 24 deletions(-) > -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org