libnvmf_context_set_devid_file(9) libnvme API manual libnvmf_context_set_devid_file(9)

libnvmf_context_set_devid_file - Set devid file for context

int libnvmf_context_set_devid_file (struct libnvmf_context *fctx , const char *devid_file );

Fabrics context
Path to the output file

Configure a file that libnvmf_connect uses to record the kernel-assigned device name (for example, "nvme0").

If the controller is already connected, the existing device name is written. Otherwise, the device name is written after the controller is connected.

The output file is created before attempting the connection. If the file cannot be created, for example because the parent directory does not exist, libnvmf_connect fails without attempting the connection.

This is intended for applications that need to identify the device associated with a connection, for example to disconnect it later.

0 on success, negative error code otherwise.

libnvmf_context_set_devid_file September 2026