---
name: "nvmf_add_ctrl"
section: "2"
platform: "linux"
package: "libnvme-dev"
version: "1.13-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/nvmf_add_ctrl"
---

# nvmf\_add\_ctrl(2)

Connect a controller and update topology

## NAME

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

## SYNOPSIS

**int nvmf\_add\_ctrl** **(nvme\_host\_t h** *,* **nvme\_ctrl\_t c** *,* **const struct nvme\_fabrics\_config \*cfg** *);*

## ARGUMENTS

- h

  Host to which the controller should be attached

- c

  Controller to be connected

- cfg

  Default configuration for the controller

## 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; on failure errno is set and -1 is returned.
