nbd_aio_opt_list_meta_context(3)
π nbd_aio_opt_list_meta_context β the libnbd glow-up page
okay so bestie, welcome to nbd_aio_opt_list_meta_context(3) from the LIBNBD manual, section 3 π this is the async girlie of meta-context listing and she ate, no cap β¨
πΈ NAME πΈ
nbd_aio_opt_list_meta_context β ask for the list of available meta contexts, using an implicit query π¦
β¨ SYNOPSIS β¨
#include <libnbd.h>
typedef struct {
int (*callback) (void *user_data, const char *name);
void *user_data;
void (*free) (void *user_data);
} nbd_context_callback;
typedef struct {
int (*callback) (void *user_data, int *error);
void *user_data;
void (*free) (void *user_data);
} nbd_completion_callback;
int nbd_aio_opt_list_meta_context (
struct nbd_handle *h,
nbd_context_callback context_callback,
nbd_completion_callback completion_callback
);
π DESCRIPTION π
okay so picture this π β you're asking the server to list the meta contexts that are available for the export you already picked out with the most recent nbd_set_export_name(3) or nbd_connect_uri(3), and it also matches up against a list of queries from earlier calls to nbd_add_meta_context(3) π₯ if you'd rather hand over your own explicit query list, go look at nbd_aio_opt_list_meta_context_queries(3) instead, iykyk.
lowkey important: this only works if nbd_set_opt_mode(3) turned option mode on. no opt mode, no vibes π
so how do you know when the request is done? wait for nbd_aio_is_connecting(3) to return false β³ or you can hand over the optional completion_callback, which gets invoked exactly the way it's described in "Completion callbacks" in libnbd(3) β except it's automatically retired no matter what the return value is, periodt π
also real talk: figuring out whether the server returned an error (which is what the return value of the synchronous counterpart does for you) is only possible with a completion callback. so likeβ¦ use one if you care π
β RETURN VALUE β
this call returns an integer β₯ 0 π
π ERRORS π
on error -1 is returned π«
for the full deets on how to get more info about the error, go read "ERROR HANDLING" in libnbd(3).
also, these parameters must not be NULL: "h". for more info see "Non-NULL parameters" in libnbd(3) π§
π¦ HANDLE STATE π¦
nbd_aio_opt_list_meta_context 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
so basically: option-mode handshake era only, bestie π everywhere else is a no π
π VERSION π
this function first appeared in libnbd 1.6 π
if you need to test at compile time whether this function is available, check if the following macro is defined:
#define LIBNBD_HAVE_NBD_AIO_OPT_LIST_META_CONTEXT 1
π SEE ALSO π
nbd_add_meta_context(3), nbd_aio_is_connecting(3), nbd_aio_opt_list_meta_context_queries(3), nbd_connect_uri(3), nbd_create(3), nbd_opt_list_meta_context(3), nbd_set_export_name(3), nbd_set_opt_mode(3), libnbd(3).
π«Ά 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
and that's the whole page, bestie πβ¨ this was libnbd-1.25.8, dated 2026-10-13 β mwah, go slay your meta contexts π
π¦π
π¦ 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