libnvmf\_tid\_parse(9) libnvme API manual libnvmf\_tid\_parse(9)

# [NAME](#NAME)

libnvmf\_tid\_parse - Allocate a TID from a semicolon-separated key=value string.

# [SYNOPSIS](#SYNOPSIS)

**int libnvmf\_tid\_parse** **(struct libnvme\_global\_ctx \*ctx ,** **const char \*str ,** **struct libnvmf\_tid \*\*out );**

# [ARGUMENTS](#ARGUMENTS)

[ctx](#ctx)

Global context used only for logging the diagnostics below.

[str](#str)

Input string, e.g. "transport=tcp;traddr=1.2.3.4;trsvcid=8009".

[out](#out)

The allocated TID on success; NULL on error.

# [DESCRIPTION](#DESCRIPTION)

Recognized keys are the "nvme connect" option names: transport, traddr, trsvcid, nqn, host-traddr, host-iface, hostnqn, hostid. (The "nqn", "host-traddr", and "host-iface" string keys map onto the struct's subsysnqn, host\_traddr, and host\_iface fields, whose names follow the C-identifier convention.) Unknown keys, bare keys (no '='), and empty values are logged at WARN level and skipped. Whitespace around keys and values is trimmed. Like **libnvmf\_tid\_from\_fields**, a traddr/host-traddr that is not numeric on an IP transport fails the whole parse.

# [RETURN](#RETURN)

0 on success (\**out* is the allocated TID); -EINVAL if *ctx*, *out* or *str* is NULL, or a traddr/host-traddr is not numeric on an IP transport; -ENOMEM on allocation failure.

libnvmf\_tid\_parse October 2026

---

Document: libnvmf_tid_parse-libnvme3(2) from nvme-cli 3.2-r0 (Chainguard OS)
Source: https://github.com/linux-nvme/nvme-cli
