libnvmf\_read\_hostnqn(9) libnvme API manual libnvmf\_read\_hostnqn(9)

# [NAME](#NAME)

libnvmf\_read\_hostnqn - Get the configured host nvm qualified name

# [SYNOPSIS](#SYNOPSIS)

**char * libnvmf\_read\_hostnqn** **(struct libnvme\_global\_ctx \*ctx );**

# [ARGUMENTS](#ARGUMENTS)

[ctx](#ctx)

struct libnvme\_global\_ctx object

# [DESCRIPTION](#DESCRIPTION)

Return *ctx*'s hostnqn default if one is set, otherwise read the name from $SYSCONFDIR/nvme/hostnqn. $SYSCONFDIR is usually /etc. An empty *ctx* default suppresses the file lookup.

This is not the identity a connect uses. See **libnvmf\_host\_get\_ids** for the full resolution order.

# [RETURN](#RETURN)

The host nqn, or NULL if unsuccessful. If found, the caller is responsible to free the string.

libnvmf\_read\_hostnqn September 2026

---

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