aboutsummaryrefslogtreecommitdiff
path: root/include/block
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>2021-06-10 13:07:50 +0300
committerEric Blake <eblake@redhat.com>2021-06-18 10:59:53 -0500
commite0e67cbe58f42500e3451c46b3caba572f2a965f (patch)
treeadc32dfa370ad235d0318fad2571c8bc6829aa55 /include/block
parent130d49baa50655729f09efb72e77bebf09421dd7 (diff)
nbd/client-connection: implement connection retry
Add an option for a thread to retry connecting until it succeeds. We'll use nbd/client-connection both for reconnect and for initial connection in nbd_open(), so we need a possibility to use same NBDClientConnection instance to connect once in nbd_open() and then use retry semantics for reconnect. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <20210610100802.5888-21-vsementsov@virtuozzo.com> Reviewed-by: Eric Blake <eblake@redhat.com> [eblake: grammar tweak] Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'include/block')
-rw-r--r--include/block/nbd.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/block/nbd.h b/include/block/nbd.h
index 5d86e6a393..5bb54d831c 100644
--- a/include/block/nbd.h
+++ b/include/block/nbd.h
@@ -409,6 +409,8 @@ const char *nbd_err_lookup(int err);
/* nbd/client-connection.c */
typedef struct NBDClientConnection NBDClientConnection;
+void nbd_client_connection_enable_retry(NBDClientConnection *conn);
+
NBDClientConnection *nbd_client_connection_new(const SocketAddress *saddr,
bool do_negotiation,
const char *export_name,