libnvmf_tid_parse(9)

πŸ“¦ version 3.2, in arch rolling

πŸ’… libnvmf_tid_parse β€” libnvme API manual, section 9 ✨

okay so bestie, buckle up, because this is the libnvmf_tid_parse(9) page and it's literally about turning one little string into a whole entire TID. iconic behavior tbh πŸŽ€


🌸 NAME 🌸

libnvmf_tid_parse β€” allocate a TID from a semicolon-separated key=value string. yes, that's the whole vibe. πŸ¦‹


⭐ SYNOPSIS ⭐

int libnvmf_tid_parse (struct libnvme_global_ctx *ctx , const char *str
, struct libnvmf_tid **out );

πŸ’– ARGUMENTS πŸ’–

  • ctx β€” the global context. honestly it's only here so it can log the diagnostics mentioned below. main character energy: low, but it is on the cast list. πŸ™ˆ
  • str β€” the input string, like for example:
"transport=tcp;traddr=1.2.3.4;trsvcid=8009"

yes bestie that's a whole connection in one line, slay πŸ’…

  • out β€” on success, the allocated TID lives here. on error? NULL. no cap. 😭

πŸ”₯ DESCRIPTION πŸ”₯

The recognized keys are the "nvme connect" option names, periodt:

  • transport
  • traddr
  • trsvcid
  • nqn
  • host-traddr
  • host-iface
  • hostnqn
  • hostid

so far so good, right? but lowkey here's the little mapping tea β˜•: the "nqn", "host-traddr", and "host-iface" string keys map onto the struct's subsysnqn, host_traddr, and host_iface fields β€” those field names follow the C-identifier convention, which is why they don't match the key spelling. iykyk 🧚

now for the messy part, and i'm gonna be so fr fr with you:

Unknown keys, bare keys (no =), and empty values are logged at WARN level and skipped. Whitespace around keys and values is trimmed. so like, don't panic, it just quietly side-eyes them and moves on. πŸ™ˆ

and the big one: like libnvmf_tid_from_fields, a traddr/host-traddr that is not numeric on an IP transport fails the whole parse. not just that one key β€” the whole parse. it's giving all-or-nothing πŸ’€


πŸ‘‘ RETURN πŸ‘‘

  • 0 on success β€” and *out is the allocated TID, we love a happy ending πŸ’–
  • -EINVAL if ctx, out or str is NULL, or a traddr/host-traddr is not numeric on an IP transport 🚫
  • -ENOMEM on allocation failure β€” the malloc said no and we respect it 😭

🌈 SEE ALSO 🌈

okay technically this original page didn't give us a SEE ALSO section, so there's nothing to list here β€” but like, libnvmf_tid_from_fields gets a shoutout up in DESCRIPTION, so go say hi to that one bestie 🫢


and that's the page!! 🌸 written under the libnvme banner, version dated October 2026, and the footer still says libnvmf_tid_parse(9) because some things are eternal. mwah, go parse some TIDs, you're gonna ate πŸ’…βœ¨

πŸ“¦ where this page comes from