diff options
author | Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> | 2021-06-15 14:07:05 -0500 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2021-06-18 10:59:53 -0500 |
commit | 5276c87c12f4c2a2db0bf343f6d3092816f0afc6 (patch) | |
tree | d051e4793693fce1a62f870a7bc507b24db0817c /include/block/nbd.h | |
parent | 248d4701989dbe8de1c06aa8f65ef38f289df87b (diff) |
nbd: move connection code from block/nbd to nbd/client-connection
We now have bs-independent connection API, which consists of four
functions:
nbd_client_connection_new()
nbd_client_connection_release()
nbd_co_establish_connection()
nbd_co_establish_connection_cancel()
Move them to a separate file together with NBDClientConnection
structure which becomes private to the new API.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20210610100802.5888-18-vsementsov@virtuozzo.com>
[eblake: comment tweaks]
Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'include/block/nbd.h')
-rw-r--r-- | include/block/nbd.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/block/nbd.h b/include/block/nbd.h index 5f34d23bb0..57381be76f 100644 --- a/include/block/nbd.h +++ b/include/block/nbd.h @@ -406,4 +406,15 @@ const char *nbd_info_lookup(uint16_t info); const char *nbd_cmd_lookup(uint16_t info); const char *nbd_err_lookup(int err); +/* nbd/client-connection.c */ +typedef struct NBDClientConnection NBDClientConnection; + +NBDClientConnection *nbd_client_connection_new(const SocketAddress *saddr); +void nbd_client_connection_release(NBDClientConnection *conn); + +QIOChannelSocket *coroutine_fn +nbd_co_establish_connection(NBDClientConnection *conn, Error **errp); + +void coroutine_fn nbd_co_establish_connection_cancel(NBDClientConnection *conn); + #endif |