libnvmf\_add\_ctrl(9) libnvme API manual libnvmf\_add\_ctrl(9)

# [NAME](#NAME)

libnvmf\_add\_ctrl - Connect a controller and update topology

# [SYNOPSIS](#SYNOPSIS)

**int libnvmf\_add\_ctrl** **(struct libnvme\_host \*h ,** **struct libnvme\_ctrl \*c );**

# [ARGUMENTS](#ARGUMENTS)

[h](#h)

Host to which the controller should be attached

[c](#c)

Controller to be connected

# [DESCRIPTION](#DESCRIPTION)

Issues a 'connect' command to the NVMe-oF controller and inserts *c* into the topology using *h* as parent. *c* must be initialized and not connected to the topology.

# [RETURN](#RETURN)

0 on success, negative error code otherwise.

libnvmf\_add\_ctrl October 2026

---

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