Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions libnvme/libnvme/nvme.i
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ struct libnvmf_context {};
NBFT
******/
%{
static PyObject *ssns_to_dict(struct nbft_info_subsystem_ns *ss)
static PyObject *ssns_to_dict(struct libnbft_subsystem_ns *ss)
{
unsigned int i;
PyObject *output = PyDict_New();
Expand All @@ -1073,14 +1073,14 @@ struct libnvmf_context {};
{
PyObject *nid;
switch (ss->nid_type) {
case NBFT_INFO_NID_TYPE_EUI64:
case LIBNBFT_NID_TYPE_EUI64:
PyDict_SetItemStringDecRef(output, "nid_type", PyUnicode_FromString("eui64"));
nid = PyUnicode_FromFormat("%02x%02x%02x%02x%02x%02x%02x%02x",
ss->nid[0], ss->nid[1], ss->nid[2], ss->nid[3],
ss->nid[4], ss->nid[5], ss->nid[6], ss->nid[7]);
break;

case NBFT_INFO_NID_TYPE_NGUID:
case LIBNBFT_NID_TYPE_NGUID:
PyDict_SetItemStringDecRef(output, "nid_type", PyUnicode_FromString("nguid"));
nid = PyUnicode_FromFormat("%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
ss->nid[0], ss->nid[1], ss->nid[2], ss->nid[3],
Expand All @@ -1089,7 +1089,7 @@ struct libnvmf_context {};
ss->nid[12], ss->nid[13], ss->nid[14], ss->nid[15]);
break;

case NBFT_INFO_NID_TYPE_NS_UUID:
case LIBNBFT_NID_TYPE_NS_UUID:
{
char uuid_str[NVME_UUID_LEN_STRING];
PyDict_SetItemStringDecRef(output, "nid_type", PyUnicode_FromString("uuid"));
Expand Down Expand Up @@ -1121,7 +1121,7 @@ struct libnvmf_context {};
return output;
}

static PyObject *hfi_to_dict(struct nbft_info_hfi *hfi)
static PyObject *hfi_to_dict(struct libnbft_hfi *hfi)
{
PyObject *output = PyDict_New();

Expand Down Expand Up @@ -1164,7 +1164,7 @@ struct libnvmf_context {};
return output;
}

static PyObject *discovery_to_dict(struct nbft_info_discovery *disc)
static PyObject *discovery_to_dict(struct libnbft_discovery *disc)
{
PyObject *output = PyDict_New();

Expand All @@ -1180,7 +1180,7 @@ struct libnvmf_context {};
return output;
}

static PyObject *nbft_to_pydict(struct nbft_info *nbft)
static PyObject *nbft_to_pydict(struct libnbft_info *nbft)
{
PyObject *val;
PyObject *output = PyDict_New();
Expand All @@ -1199,17 +1199,17 @@ struct libnvmf_context {};
PyDict_SetItemStringDecRef(host, "host_id_configured", PyBool_FromLong(nbft->host.host_id_configured));
PyDict_SetItemStringDecRef(host, "host_nqn_configured", PyBool_FromLong(nbft->host.host_nqn_configured));

val = PyUnicode_FromString(nbft->host.primary == NBFT_INFO_PRIMARY_ADMIN_HOST_FLAG_NOT_INDICATED ? "not indicated" :
nbft->host.primary == NBFT_INFO_PRIMARY_ADMIN_HOST_FLAG_UNSELECTED ? "unselected" :
nbft->host.primary == NBFT_INFO_PRIMARY_ADMIN_HOST_FLAG_SELECTED ? "selected" : "reserved");
val = PyUnicode_FromString(nbft->host.primary == LIBNBFT_PRIMARY_ADMIN_HOST_FLAG_NOT_INDICATED ? "not indicated" :
nbft->host.primary == LIBNBFT_PRIMARY_ADMIN_HOST_FLAG_UNSELECTED ? "unselected" :
nbft->host.primary == LIBNBFT_PRIMARY_ADMIN_HOST_FLAG_SELECTED ? "selected" : "reserved");
PyDict_SetItemStringDecRef(host, "primary_admin_host_flag", val);

PyDict_SetItemStringDecRef(output, "host", host);
}

{
size_t ss_num = 0;
struct nbft_info_subsystem_ns **ss;
struct libnbft_subsystem_ns **ss;
PyObject *subsystem;

/* First, let's find how many entries there are */
Expand All @@ -1227,7 +1227,7 @@ struct libnvmf_context {};

{
size_t hfi_num = 0;
struct nbft_info_hfi **hfi;
struct libnbft_hfi **hfi;
PyObject *hfis;

/* First, let's find how many entries there are */
Expand All @@ -1245,7 +1245,7 @@ struct libnvmf_context {};

{
size_t disc_num = 0;
struct nbft_info_discovery **disc;
struct libnbft_discovery **disc;
PyObject *discovery;

/* First, let's find how many entries there are */
Expand All @@ -1268,7 +1268,7 @@ struct libnvmf_context {};

PyObject *nbft_get(struct libnvme_global_ctx *ctx, const char * filename)
{
struct nbft_info *nbft;
struct libnbft_info *nbft;
PyObject *output;
int ret;

Expand Down
5 changes: 3 additions & 2 deletions libnvme/src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,15 @@ headers = [

if want_fabrics
sources += [
'nvme/accessors-fabrics.c',
'nvme/fabrics.c',
'nvme/nbft.c',
'nvme/accessors-fabrics.c',
]
headers += [
'nvme/accessors-fabrics.h',
'nvme/fabrics.h',
'nvme/nbft-types.h',
'nvme/nbft.h',
'nvme/accessors-fabrics.h',
]
else
sources += [
Expand Down
14 changes: 7 additions & 7 deletions libnvme/src/nvme/fabrics.c
Original file line number Diff line number Diff line change
Expand Up @@ -2602,7 +2602,7 @@ __public int libnvmf_nbft_read_files(struct libnvme_global_ctx *ctx, char *path,
struct nbft_file_entry **head)
{
struct nbft_file_entry *entry = NULL;
struct nbft_info *nbft;
struct libnbft_info *nbft;
struct dirent **dent;
char filename[PATH_MAX];
int i, count, ret;
Expand Down Expand Up @@ -2650,7 +2650,7 @@ __public void libnvmf_nbft_free(struct libnvme_global_ctx *ctx, struct nbft_file
}

static bool validate_uri(struct libnvme_global_ctx *ctx,
struct nbft_info_discovery *dd,
struct libnbft_discovery *dd,
struct libnvmf_uri *uri)
{
if (!uri) {
Expand Down Expand Up @@ -2678,7 +2678,7 @@ static bool validate_uri(struct libnvme_global_ctx *ctx,
static int nbft_connect(struct libnvme_global_ctx *ctx,
struct libnvmf_context *fctx, struct libnvme_host *h,
struct nvmf_disc_log_entry *e,
struct nbft_info_subsystem_ns *ss)
struct libnbft_subsystem_ns *ss)
{
libnvme_ctrl_t c;
int saved_log_level;
Expand Down Expand Up @@ -2735,7 +2735,7 @@ static int nbft_connect(struct libnvme_global_ctx *ctx,
}

static int nbft_discovery(struct libnvme_global_ctx *ctx,
struct libnvmf_context *fctx, struct nbft_info_discovery *dd,
struct libnvmf_context *fctx, struct libnbft_discovery *dd,
struct libnvme_host *h, struct libnvme_ctrl *c)
{
struct nvmf_discovery_log *log = NULL;
Expand Down Expand Up @@ -2833,9 +2833,9 @@ __public int libnvmf_discovery_nbft(struct libnvme_global_ctx *ctx,
const char *hostnqn = NULL, *hostid = NULL, *host_traddr = NULL;
char uuid[NVME_UUID_LEN_STRING];
struct nbft_file_entry *entry = NULL;
struct nbft_info_subsystem_ns **ss;
struct nbft_info_hfi *hfi;
struct nbft_info_discovery **dd;
struct libnbft_subsystem_ns **ss;
struct libnbft_hfi *hfi;
struct libnbft_discovery **dd;
struct libnvme_host *h;
int ret, rr, i;

Expand Down
Loading
Loading