---
name: "libnvmf_add_ctrl-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_add_ctrl-libnvme3"
---

# libnvmf\_add\_ctrl-libnvme3(2)

Connect a controller and update topology

## NAME

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

## SYNOPSIS

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

## ARGUMENTS

- h

  Host to which the controller should be attached

- c

  Controller to be connected

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

0 on success, negative error code otherwise.
