---
name: "libnvmf_connect_args_emit-libnvme3"
section: "2"
platform: "linux"
package: "nvme-cli"
version: "3.2-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libnvmf_connect_args_emit-libnvme3"
---

# libnvmf\_connect\_args\_emit-libnvme3(2)

render a connection as "nvme connect" options.

## NAME

libnvmf\_connect\_args\_emit - render a connection as "nvme connect" options.

## SYNOPSIS

**int libnvmf\_connect\_args\_emit** **(const struct libnvmf\_tid \*tid** *,* **const struct libnvmf\_params \*params** *,* **void (\*callback)(const char \*arg, void \*user\_data)** *,* **void \*user\_data** *);*

## ARGUMENTS

- tid

  addressing + identity, or NULL to emit the parameters only

- params

  connection parameters, or NULL to emit the TID only

- callback

  called once per formatted option, e.g. "--transport=tcp"; the string is only valid for the duration of the call

- user\_data

  caller context passed to *callback*

## DESCRIPTION

Emits the TID's set fields first, in fixed order (--transport, --traddr, --trsvcid, --nqn, --host-traddr, --host-iface, --hostnqn, --hostid), then the parameters in their iteration order.  Unset and reset parameters are skipped so the kernel default applies; a boolean parameter is emitted as a bare "--flag" when true and skipped when false.  Consumer-private options are the caller's to append.

This is the consumption path for the resolved configuration: each connection becomes the option list of one "nvme connect" invocation. It also renders a connection as a human-readable, copy-pasteable command line for "config show" style output.

## RETURN

0 on success, -EINVAL when *callback* is NULL, -ENOMEM when formatting an option fails (the emission stops there).
