libnvmf_context_create(9)

NAME
libnvmf_context_create - Create a new fabrics context for discovery/connect

SYNOPSIS
int libnvmf_context_create (struct libnvme_global_ctx *ctx , bool (*decide_retry)(struct libnvmf_context *fctx, int err, void *user_data) , void (*connected)(struct libnvmf_context *fctx, struct libnvme_ctrl *c, void *user_data) , void (*already_connected)(struct libnvmf_context *fctx, struct libnvme_host *host, const char *subsysnqn, const char *transport, const char *traddr, const char *trsvcid, void *user_data) , void *user_data , struct libnvmf_context **fctxp );

ARGUMENTS

ctx Global context

decide_retry
    Hook to decide if a retry should be attempted

connected
    Hook invoked when a connection is established

already_connected
    Hook invoked if already connected

user_data
    User data passed to hooks

fctxp
    Pointer to store the created context

DESCRIPTION
Allocates and initializes a new fabrics context for discovery/connect operations.

RETURN
0 on success, negative error code otherwise.