---
name: "libnvmf_config_read-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_config_read-libnvme3"
---

# libnvmf\_config\_read-libnvme3(2)

read and resolve a connection configuration.

## NAME

libnvmf\_config\_read - read and resolve a connection configuration.

## SYNOPSIS

**int libnvmf\_config\_read** **(struct libnvme\_global\_ctx \*ctx** *,* **const char \*file** *,* **struct libnvmf\_config \*\*out** *);*

## ARGUMENTS

- ctx

  libnvme global context

- file

  main configuration file, or NULL for the default (/etc/nvme/nvme-fabrics.conf).  The drop-in directory is always derived from the file name: the .conf files under \<file\>.d/.

- out

  the resolved configuration on success; NULL on error

## DESCRIPTION

Reads the main file (if it exists) and the drop-ins (if the directory exists) and resolves them into the flat connection list.  An absent configuration is valid and yields an empty list.  Any validation error in any file fails the read as a unit; diagnostics carry file:line and are reported through *ctx*.

## RETURN

0 on success (\**out* is the resolved configuration), negative errno otherwise (\**out* is NULL).
