nbd_aio_connect_vsock(3)
π nbd_aio_connect_vsock π
okay so this is the LIBNBD manual, section 3 β and bestie, we're talking about the async girlie that connects you to an NBD server over an AF_VSOCK socket. π
β¨ NAME β¨
nbd_aio_connect_vsock β connect to the NBD server over AF_VSOCK socket π¦
π SYNOPSIS π
#include <libnbd.h>
int nbd_aio_connect_vsock (
struct nbd_handle *h, uint32_t cid, uint32_t port
);
πΈ DESCRIPTION πΈ
okay so this starts connecting to the NBD server over the AF_VSOCK protocol to the server cid:port. The parameters behave exactly as documented in nbd_connect_vsock(3) β no cap, that's where the deets live. β¨
π RETURN VALUE π
If the call is successful, the function returns 0. slay. β
π₯ 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). π no NULL shenanigans, periodt.
β¨ NOTES β¨
π Asynchronous connect call π
You can check if the connection attempt is still underway by calling nbd_aio_is_connecting(3). If nbd_set_opt_mode(3) is enabled, the connection is ready for manual option negotiation once nbd_aio_is_negotiating(3) returns true; otherwise, the connection attempt will include the NBD handshake, and is ready for use once nbd_aio_is_ready(3) returns true. π§
π HANDLE STATE π
nbd_aio_connect_vsock can be called when the handle is in the following state:
- Handle created, before connecting β β allowed
- Connecting β β error
- Connecting & handshaking (
opt_mode) β β error - Connected to the server β β error
- Connection shut down β β error
- Handle dead β β error
β VERSION β
This function first appeared in libnbd 1.2. π
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_CONNECT_VSOCK 1
π¦ SEE ALSO π¦
nbd_aio_is_connecting(3), nbd_aio_is_negotiating(3), nbd_aio_is_ready(3), nbd_connect_vsock(3), nbd_create(3), nbd_set_opt_mode(3), libnbd(3), vsock(7). iykyk π
πΈ AUTHORS πΈ
- Eric Blake
- Richard W.M. Jones
π COPYRIGHT π
Copyright Red Hat π«Ά
π LICENSE π
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
xoxo, bestie β this one is from libnbd-1.25.8, dated 2026-10-13, and it's literally the nbd_aio_connect_vsock(3) page. mwah πβ¨
π¦ where this page comes from
- centos-stream 10: libnbd-devel 1.25.8-1.el10 Β· LGPL-2.0-or-later AND BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms