986ba7710f
- Backport the NBFT support from git master
76 lines
2.3 KiB
Diff
76 lines
2.3 KiB
Diff
From 34c197e0ac2d57734ab775f00b2d0758aca7b82f Mon Sep 17 00:00:00 2001
|
|
From: John Meneghini <jmeneghi@redhat.com>
|
|
Date: Fri, 14 Apr 2023 10:53:58 -0400
|
|
Subject: [PATCH 01/11] nbft: make lookup_ctrl function public
|
|
|
|
To prepare for the addition of nbft functionality fixup the fabrics
|
|
declarations.
|
|
|
|
Signed-off-by: John Meneghini <jmeneghi@redhat.com>
|
|
---
|
|
fabrics.c | 12 ++----------
|
|
fabrics.h | 10 ++++++++++
|
|
2 files changed, 12 insertions(+), 10 deletions(-)
|
|
|
|
diff --git a/fabrics.c b/fabrics.c
|
|
index f8078e59..80827b16 100644
|
|
--- a/fabrics.c
|
|
+++ b/fabrics.c
|
|
@@ -43,6 +43,7 @@
|
|
#include "libnvme.h"
|
|
#include "nvme-print.h"
|
|
#include "nvme-print-json.h"
|
|
+#include "fabrics.h"
|
|
|
|
#define PATH_NVMF_DISC SYSCONFDIR "/nvme/discovery.conf"
|
|
#define PATH_NVMF_CONFIG SYSCONFDIR "/nvme/config.json"
|
|
@@ -110,15 +111,6 @@ static const char *nvmf_config_file = "Use specified JSON configuration file or
|
|
OPT_FLAG("data-digest", 'G', &c.data_digest, nvmf_data_digest), \
|
|
OPT_FLAG("tls", 0, &c.tls, nvmf_tls) \
|
|
|
|
-struct tr_config {
|
|
- const char *subsysnqn;
|
|
- const char *transport;
|
|
- const char *traddr;
|
|
- const char *host_traddr;
|
|
- const char *host_iface;
|
|
- const char *trsvcid;
|
|
-};
|
|
-
|
|
/*
|
|
* Compare two C strings and handle NULL pointers gracefully.
|
|
* If either of the two strings is NULL, return 0
|
|
@@ -202,7 +194,7 @@ static nvme_ctrl_t lookup_discovery_ctrl(nvme_root_t r, struct tr_config *trcfg)
|
|
return __lookup_ctrl(r, trcfg, disc_ctrl_config_match);
|
|
}
|
|
|
|
-static nvme_ctrl_t lookup_ctrl(nvme_root_t r, struct tr_config *trcfg)
|
|
+nvme_ctrl_t lookup_ctrl(nvme_root_t r, struct tr_config *trcfg)
|
|
{
|
|
return __lookup_ctrl(r, trcfg, ctrl_config_match);
|
|
}
|
|
diff --git a/fabrics.h b/fabrics.h
|
|
index d1e16fc5..02cebf5d 100644
|
|
--- a/fabrics.h
|
|
+++ b/fabrics.h
|
|
@@ -2,6 +2,16 @@
|
|
#ifndef _FABRICS_H
|
|
#define _FABRICS_H
|
|
|
|
+struct tr_config {
|
|
+ const char *subsysnqn;
|
|
+ const char *transport;
|
|
+ const char *traddr;
|
|
+ const char *host_traddr;
|
|
+ const char *host_iface;
|
|
+ const char *trsvcid;
|
|
+};
|
|
+
|
|
+extern nvme_ctrl_t lookup_ctrl(nvme_root_t r, struct tr_config *trcfg);
|
|
extern int nvmf_discover(const char *desc, int argc, char **argv, bool connect);
|
|
extern int nvmf_connect(const char *desc, int argc, char **argv);
|
|
extern int nvmf_disconnect(const char *desc, int argc, char **argv);
|
|
--
|
|
2.39.2
|
|
|