Skip to content
Closed
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
4 changes: 2 additions & 2 deletions Documentation/nvme-config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ OPTIONS

-I <hostid>::
--hostid=<hostid>::
UUID(Universally Unique Identifier) to be discovered which should be
formatted.
Deprecated and ignored. This option is kept around for backwards
compatibility. Use --hostnqn instead.

-S <secret>::
--dhchap-secret=<secret>::
Expand Down
4 changes: 2 additions & 2 deletions Documentation/nvme-connect-all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ OPTIONS

-I <hostid>::
--hostid=<hostid>::
UUID(Universally Unique Identifier) to be discovered which should be
formatted.
Deprecated and ignored. This option is kept around for backwards
compatibility. Use --hostnqn instead.

-r <filename>::
--raw=<filename>::
Expand Down
4 changes: 2 additions & 2 deletions Documentation/nvme-connect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ OPTIONS

-I <hostid>::
--hostid=<hostid>::
UUID(Universally Unique Identifier) to be discovered which should be
formatted.
Deprecated and ignored. This option is kept around for backwards
compatibility. Use --hostnqn instead.

-J <filename>::
--config=<filename>::
Expand Down
4 changes: 2 additions & 2 deletions Documentation/nvme-discover.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ OPTIONS

-I <hostid>::
--hostid=<hostid>::
UUID(Universally Unique Identifier) to be discovered which should be
formatted.
Deprecated and ignored. This option is kept around for backwards
compatibility. Use --hostnqn instead.

-r <filename>::
--raw=<filename>::
Expand Down
6 changes: 3 additions & 3 deletions fabrics.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static const char *nvmf_trsvcid = "transport service id (e.g. IP port)";
static const char *nvmf_htraddr = "host traddr (e.g. FC WWN's)";
static const char *nvmf_hiface = "host interface (for tcp transport)";
static const char *nvmf_hostnqn = "user-defined hostnqn";
static const char *nvmf_hostid = "user-defined hostid (if default not used)";
static const char *nvmf_hostid = "(deprecated and ignored)";
static const char *nvmf_hostkey = "user-defined dhchap key (if default not used)";
static const char *nvmf_ctrlkey = "user-defined dhchap controller key (for bi-directional authentication)";
static const char *nvmf_nr_io_queues = "number of io queues to use (default is core count)";
Expand Down Expand Up @@ -334,7 +334,7 @@ static int setup_common_context(struct nvmf_context *fctx,
return err;

err = nvmf_context_set_hostnqn(fctx,
fa->hostnqn, fa->hostid);
fa->hostnqn);
if (err)
return err;

Expand Down Expand Up @@ -367,7 +367,7 @@ static int create_common_context(struct nvme_global_ctx *ctx,
if (err)
goto err;

err = nvmf_context_set_hostnqn(fctx, fa->hostnqn, fa->hostid);
err = nvmf_context_set_hostnqn(fctx, fa->hostnqn);
if (err)
goto err;

Expand Down
4 changes: 0 additions & 4 deletions libnvme/doc/config-schema.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
"type": "string",
"maxLength": 223
},
"hostid": {
"description": "NVMe host ID",
"type": "string"
},
"dhchap_key": {
"description": "Host DH-HMAC-CHAP key",
"type": "string"
Expand Down
2 changes: 1 addition & 1 deletion libnvme/examples/discover-loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ int main()
nvme_free_global_ctx(ctx);
return 1;
}
ret = nvme_get_host(ctx, NULL, NULL, &h);
ret = nvme_get_host(ctx, NULL, &h);
if (ret) {
fprintf(stderr, "Failed to allocated memory\n");
return 1;
Expand Down
15 changes: 2 additions & 13 deletions libnvme/libnvme/nvme.i
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,8 @@
free(val);
return obj;
}
PyObject *read_hostid() {
char * val = nvme_read_hostid();
PyObject * obj = val ? PyUnicode_FromString(val) : Py_NewRef(Py_None);
free(val);
return obj;
}
%}
PyObject *read_hostnqn();
PyObject *read_hostid();

%exception nvme_ctrl::connect {
connect_err = 0;
Expand Down Expand Up @@ -363,10 +356,8 @@ struct nvme_global_ctx {

struct nvme_host {
%immutable hostnqn;
%immutable hostid;
%immutable hostsymname;
char *hostnqn;
char *hostid;
char *hostsymname;
%extend {
char *dhchap_host_key;
Expand Down Expand Up @@ -546,18 +537,16 @@ struct nvme_ns {

%pythonappend nvme_host::nvme_host(struct nvme_global_ctx *ctx,
const char *hostnqn,
const char *hostid,
const char *hostkey,
const char *hostsymname) {
self.__parent = ctx # Keep a reference to parent to ensure garbage collection happens in the right order}
%extend nvme_host {
nvme_host(struct nvme_global_ctx *ctx,
const char *hostnqn = NULL,
const char *hostid = NULL,
const char *hostkey = NULL,
const char *hostsymname = NULL) {
nvme_host_t h;
if (nvme_get_host(ctx, hostnqn, hostid, &h))
if (nvme_get_host(ctx, hostnqn, &h))
return NULL;
if (hostsymname)
nvme_host_set_hostsymname(h, hostsymname);
Expand All @@ -580,7 +569,7 @@ struct nvme_ns {
}

PyObject* __str__() {
return PyUnicode_FromFormat("nvme.host(%s,%s)", STR_OR_NONE($self->hostnqn), STR_OR_NONE($self->hostid));
return PyUnicode_FromFormat("nvme.host(%s)", STR_OR_NONE($self->hostnqn));
}
%pythoncode %{
def subsystems(self):
Expand Down
11 changes: 0 additions & 11 deletions libnvme/libnvme/tests/test-objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,6 @@ def test_creation_with_explicit_hostnqn(self):
self.assertIsNotNone(host)
self.assertEqual(host.hostnqn, hostnqn)

def test_creation_with_hostnqn_and_hostid(self):
hostnqn = 'nqn.2014-08.com.example:test-host-props'
hostid = '11111111-2222-3333-4444-555555555555'
host = nvme.host(self.ctx, hostnqn=hostnqn, hostid=hostid)
self.assertEqual(host.hostnqn, hostnqn)
self.assertEqual(host.hostid, hostid)

def test_creation_with_hostsymname(self):
hostnqn = 'nqn.2014-08.com.example:test-host-symname'
symname = 'my-storage-host'
Expand Down Expand Up @@ -248,10 +241,6 @@ def test_read_hostnqn_returns_string_or_none(self):
hostnqn = nvme.read_hostnqn()
self.assertIsInstance(hostnqn, (str, type(None)))

def test_read_hostid_returns_string_or_none(self):
hostid = nvme.read_hostid()
self.assertIsInstance(hostid, (str, type(None)))


if __name__ == '__main__':
unittest.main()
3 changes: 0 additions & 3 deletions libnvme/src/accessors.ld
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ LIBNVME_ACCESSORS_3 {
nvme_subsystem_get_iopolicy;
nvme_subsystem_set_iopolicy;
nvme_host_get_hostnqn;
nvme_host_get_hostid;
nvme_host_get_dhchap_host_key;
nvme_host_set_dhchap_host_key;
nvme_host_get_hostsymname;
Expand Down Expand Up @@ -117,8 +116,6 @@ LIBNVME_ACCESSORS_3 {
nvme_fabric_options_set_host_iface;
nvme_fabric_options_get_host_traddr;
nvme_fabric_options_set_host_traddr;
nvme_fabric_options_get_hostid;
nvme_fabric_options_set_hostid;
nvme_fabric_options_get_hostnqn;
nvme_fabric_options_set_hostnqn;
nvme_fabric_options_get_instance;
Expand Down
5 changes: 1 addition & 4 deletions libnvme/src/libnvme.ld
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ LIBNVME_3 {
nvme_free_ns;
nvme_free_subsystem;
nvme_gen_dhchap_key;
nvme_generate_hostid;
nvme_generate_hostnqn;
nvme_generate_hostnqn_from_hostid;
nvme_generate_tls_key_identity;
nvme_generate_tls_key_identity_compat;
nvme_get_ana_log_atomic;
Expand Down Expand Up @@ -72,9 +70,9 @@ LIBNVME_3 {
nvme_get_uuid_list;
nvme_get_version;
nvme_host_get_global_ctx;
nvme_host_get_ids;
nvme_host_is_pdc_enabled;
nvme_host_release_fds;
nvme_host_resolve_hostnqn;
Comment thread
igaw marked this conversation as resolved.
nvme_host_set_pdc_enabled;
nvme_import_tls_key;
nvme_import_tls_key_versioned;
Expand Down Expand Up @@ -144,7 +142,6 @@ LIBNVME_3 {
nvme_path_get_queue_depth;
nvme_random_uuid;
nvme_read_config;
nvme_read_hostid;
nvme_read_hostnqn;
nvme_read_key;
nvme_read_nbft;
Expand Down
18 changes: 0 additions & 18 deletions libnvme/src/nvme/accessors.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,11 +452,6 @@ __public const char *nvme_host_get_hostnqn(const struct nvme_host *p)
return p->hostnqn;
}

__public const char *nvme_host_get_hostid(const struct nvme_host *p)
{
return p->hostid;
}

__public void nvme_host_set_dhchap_host_key(
struct nvme_host *p,
const char *dhchap_host_key)
Expand Down Expand Up @@ -668,19 +663,6 @@ __public bool nvme_fabric_options_get_host_traddr(
return p->host_traddr;
}

__public void nvme_fabric_options_set_hostid(
struct nvme_fabric_options *p,
bool hostid)
{
p->hostid = hostid;
}

__public bool nvme_fabric_options_get_hostid(
const struct nvme_fabric_options *p)
{
return p->hostid;
}

__public void nvme_fabric_options_set_hostnqn(
struct nvme_fabric_options *p,
bool hostnqn)
Expand Down
23 changes: 0 additions & 23 deletions libnvme/src/nvme/accessors.h
Original file line number Diff line number Diff line change
Expand Up @@ -634,14 +634,6 @@ const char *nvme_subsystem_get_iopolicy(const struct nvme_subsystem *p);
*/
const char *nvme_host_get_hostnqn(const struct nvme_host *p);

/**
* nvme_host_get_hostid() - Get hostid.
* @p: The &struct nvme_host instance to query.
*
* Return: The value of the hostid field, or NULL if not set.
*/
const char *nvme_host_get_hostid(const struct nvme_host *p);

/**
* nvme_host_set_dhchap_host_key() - Set dhchap_host_key.
* @p: The &struct nvme_host instance to update.
Expand Down Expand Up @@ -916,21 +908,6 @@ void nvme_fabric_options_set_host_traddr(
*/
bool nvme_fabric_options_get_host_traddr(const struct nvme_fabric_options *p);

/**
* nvme_fabric_options_set_hostid() - Set hostid.
* @p: The &struct nvme_fabric_options instance to update.
* @hostid: Value to assign to the hostid field.
*/
void nvme_fabric_options_set_hostid(struct nvme_fabric_options *p, bool hostid);

/**
* nvme_fabric_options_get_hostid() - Get hostid.
* @p: The &struct nvme_fabric_options instance to query.
*
* Return: The value of the hostid field.
*/
bool nvme_fabric_options_get_hostid(const struct nvme_fabric_options *p);

/**
* nvme_fabric_options_set_hostnqn() - Set hostnqn.
* @p: The &struct nvme_fabric_options instance to update.
Expand Down
Loading
Loading