libnvmf\_tid\_set\_identity(9) libnvme API manual libnvmf\_tid\_set\_identity(9)

# [NAME](#NAME)

libnvmf\_tid\_set\_identity - Set the subsystem and host identity together.

# [SYNOPSIS](#SYNOPSIS)

**int libnvmf\_tid\_set\_identity** **(struct libnvmf\_tid \*tid ,** **const char \*subsysnqn ,** **const char \*hostnqn ,** **const char \*hostid );**

# [ARGUMENTS](#ARGUMENTS)

[tid](#tid)

The transport ID.

[subsysnqn](#subsysnqn)

Subsystem NQN, or NULL to leave it unchanged.

[hostnqn](#hostnqn)

Host NQN, or NULL to leave it unchanged.

[hostid](#hostid)

Host Identifier, or NULL to leave it unchanged (or derive it).

# [DESCRIPTION](#DESCRIPTION)

Identity is applied after addressing -- which subsystem, and which host persona, are decided by context. A NULL argument leaves that field as-is, which is why the three are set through one call rather than per-field setters (addressing has none: it is construction-only).

hostid is never left to chance: when no hostid is set but the resulting hostnqn carries a UUID (nqn.2014-08.org.nvmexpress:uuid:&lt;X&gt;), the hostid is derived from it -- the deterministic, per-host value (TP4126), never a random one. A hostid without a hostnqn is rejected: one host is one (hostnqn, hostid) pair.

# [RETURN](#RETURN)

0 on success; -EINVAL for a NULL *tid* or a hostid without a hostnqn; -ENOMEM on allocation failure.

libnvmf\_tid\_set\_identity October 2026

---

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