nbd_aio_opt_abort3
End negotiation and close the connection
Usage
#include <libnbd.h>int nbd_aio_opt_abort (struct nbd_handle *h);
Overview
Request that the server finish negotiation, gracefully if possible, then close the connection. This can only be used if nbd_set_opt_mode(3) enabled option mode.
To determine when the request completes, wait for nbd_aio_is_connecting(3) to return false.
Return value
If the call is successful the function returns 0.
Errors
On error -1 is returned.
Refer to "ERROR HANDLING" in libnbd(3) for how to get further details of the error.
The following parameters must not be NULL: "h". For more information see "Non-NULL parameters" in libnbd(3).
Handle state
nbd_aio_opt_abort can be called when the handle is in the following state:
┌─────────────────────────────────────┬─────────────────────────┐│ Handle created, before connecting │ ❌ error ││ Connecting │ ❌ error ││ Connecting & handshaking (opt_mode) │ ✅ allowed ││ Connected to the server │ ❌ error ││ Connection shut down │ ❌ error ││ Handle dead │ ❌ error │└─────────────────────────────────────┴─────────────────────────┘
Version
This function first appeared in libnbd 1.4.
If you need to test if this function is available at compile time check if the following macro is defined:
#define LIBNBD_HAVE_NBD_AIO_OPT_ABORT 1
Releases
4 releases since Debian 11 (Bullseye); the text changed 3 times.