---
name: "libnvmf_read_hostnqn-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_read_hostnqn-libnvme3"
---

# libnvmf\_read\_hostnqn-libnvme3(2)

Get the configured host nvm qualified name

## NAME

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

## SYNOPSIS

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

## ARGUMENTS

- ctx

  struct libnvme\_global\_ctx object

## 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

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