qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5 2/2] nbd/server: Mark negotiation functions as coroutine_f


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [PATCH v5 2/2] nbd/server: Mark negotiation functions as coroutine_fn
Date: Tue, 9 Apr 2024 09:30:39 +0300
User-agent: Mozilla Thunderbird

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 <vsementsov@yandex-team.ru>
Signed-off-by: Eric Blake <eblake@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 <vsementsov@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

[Prev in Thread] Current Thread [Next in Thread]