On 08.04.24 19:00, Eric Blake wrote:
nbd_negotiate() is already marked coroutine_fn.  And given the fix in
the previous patch to have nbd_negotiate_handle_starttls not create
and wait on a g_main_loop (as that would violate coroutine
constraints), it is worth marking the rest of the related static
functions reachable only during option negotiation as also being
coroutine_fn.

Suggested-by: Vladimir Sementsov-Ogievskiy <vsement...@yandex-team.ru>
Signed-off-by: Eric Blake <ebl...@redhat.com>
---
  nbd/server.c | 102 +++++++++++++++++++++++++++++----------------------
  1 file changed, 59 insertions(+), 43 deletions(-)

diff --git a/nbd/server.c b/nbd/server.c
index 98ae0e16326..1857fba51c1 100644

[..]

  {
      int rc;
      g_autofree char *name = NULL;
@@ -755,7 +764,8 @@ struct NBDTLSServerHandshakeData {
      Coroutine *co;
  };

-static void nbd_server_tls_handshake(QIOTask *task, void *opaque)
+static coroutine_fn void

This is not, that's a callback for tls handshake, which is not coroutine 
context as I understand.
without this hunk:


Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@yandex-team.ru>


+nbd_server_tls_handshake(QIOTask *task, void *opaque)
  {
      struct NBDTLSServerHandshakeData *data = opaque;

@@ -768,8 +778,8 @@ static void nbd_server_tls_handshake(QIOTask *task, void 
*opaque)


[..]

--
Best regards,
Vladimir


Reply via email to