diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2025-01-31 20:47:58 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2025-01-31 20:47:58 +0000 |
| commit | 38e1083940a274783cc9e8ebd845e35df6d0a1ff (patch) | |
| tree | dadf1774480bdecdc8cac7ef231efa1fa9e93eae /lib/libnvmf | |
| parent | 4298ce72f650f1e93b4f43681446df2c1f8cab57 (diff) | |
Diffstat (limited to 'lib/libnvmf')
| -rw-r--r-- | lib/libnvmf/libnvmf.h | 5 | ||||
| -rw-r--r-- | lib/libnvmf/nvmf_host.c | 7 |
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/libnvmf/libnvmf.h b/lib/libnvmf/libnvmf.h index f34ccdb177e7..9840e190a24f 100644 --- a/lib/libnvmf/libnvmf.h +++ b/lib/libnvmf/libnvmf.h @@ -372,4 +372,9 @@ int nvmf_reconnect_host(int fd, const struct nvme_discovery_log_entry *dle, const char *hostnqn, struct nvmf_qpair *admin_qp, u_int num_queues, struct nvmf_qpair **io_queues, const struct nvme_controller_data *cdata); +/* + * Fetch connection status from an existing kernel host. + */ +int nvmf_connection_status(int fd, nvlist_t **nvlp); + #endif /* !__LIBNVMF_H__ */ diff --git a/lib/libnvmf/nvmf_host.c b/lib/libnvmf/nvmf_host.c index e194522870d1..89cdd5c6bb70 100644 --- a/lib/libnvmf/nvmf_host.c +++ b/lib/libnvmf/nvmf_host.c @@ -5,6 +5,7 @@ * Written by: John Baldwin <jhb@FreeBSD.org> */ +#include <sys/nv.h> #include <sys/sysctl.h> #include <errno.h> #include <fcntl.h> @@ -1001,3 +1002,9 @@ out: (void)nvmf_free_qpair(admin_qp); return (error); } + +int +nvmf_connection_status(int fd, nvlist_t **nvlp) +{ + return (nvmf_read_ioc_nv(fd, NVMF_CONNECTION_STATUS, nvlp)); +} |
