From 130d49baa50655729f09efb72e77bebf09421dd7 Mon Sep 17 00:00:00 2001 From: Vladimir Sementsov-Ogievskiy Date: Thu, 10 Jun 2021 13:07:49 +0300 Subject: nbd/client-connection: add possibility of negotiation Add arguments and logic to support nbd negotiation in the same thread after successful connection. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20210610100802.5888-20-vsementsov@virtuozzo.com> Reviewed-by: Eric Blake Signed-off-by: Eric Blake --- include/block/nbd.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'include/block/nbd.h') diff --git a/include/block/nbd.h b/include/block/nbd.h index 57381be76f..5d86e6a393 100644 --- a/include/block/nbd.h +++ b/include/block/nbd.h @@ -409,11 +409,16 @@ const char *nbd_err_lookup(int err); /* nbd/client-connection.c */ typedef struct NBDClientConnection NBDClientConnection; -NBDClientConnection *nbd_client_connection_new(const SocketAddress *saddr); +NBDClientConnection *nbd_client_connection_new(const SocketAddress *saddr, + bool do_negotiation, + const char *export_name, + const char *x_dirty_bitmap, + QCryptoTLSCreds *tlscreds); void nbd_client_connection_release(NBDClientConnection *conn); QIOChannelSocket *coroutine_fn -nbd_co_establish_connection(NBDClientConnection *conn, Error **errp); +nbd_co_establish_connection(NBDClientConnection *conn, NBDExportInfo *info, + QIOChannel **ioc, Error **errp); void coroutine_fn nbd_co_establish_connection_cancel(NBDClientConnection *conn); -- cgit v1.2.3