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
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_host_get(ctx, NULL, NULL, &h);
ret = nvme_get_host(ctx, NULL, NULL, &h);
if (ret) {
fprintf(stderr, "Failed to allocated memory\n");
return 1;
Expand Down
20 changes: 10 additions & 10 deletions libnvme/libnvme/nvme.i
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,21 @@
PyDict_SetItemString(p, key, val); /* Does NOT steal reference to val .. */
Py_XDECREF(val); /* .. therefore decrement ref. count. */
}
PyObject *hostnqn_from_file() {
char * val = nvme_hostnqn_from_file();
PyObject *read_hostnqn() {
char * val = nvme_read_hostnqn();
PyObject * obj = PyUnicode_FromString(val);
free(val);
return obj;
}
PyObject *hostid_from_file() {
char * val = nvme_hostid_from_file();
PyObject *read_hostid() {
char * val = nvme_read_hostid();
PyObject * obj = PyUnicode_FromString(val);
free(val);
return obj;
}
%}
PyObject *hostnqn_from_file();
PyObject *hostid_from_file();
PyObject *read_hostnqn();
PyObject *read_hostid();

%exception nvme_ctrl::connect {
connect_err = 0;
Expand Down Expand Up @@ -557,7 +557,7 @@ struct nvme_ns {
const char *hostkey = NULL,
const char *hostsymname = NULL) {
nvme_host_t h;
if (nvme_host_get(ctx, hostnqn, hostid, &h))
if (nvme_get_host(ctx, hostnqn, hostid, &h))
return NULL;
if (hostsymname)
nvme_host_set_hostsymname(h, hostsymname);
Expand Down Expand Up @@ -613,7 +613,7 @@ struct nvme_ns {
const char *name = NULL) {
struct nvme_subsystem *s;

if (nvme_subsystem_get(ctx, host, name, subsysnqn, &s))
if (nvme_get_subsystem(ctx, host, name, subsysnqn, &s))
return NULL;

return s;
Expand Down Expand Up @@ -1245,13 +1245,13 @@ struct nvme_ns {
PyObject *output;
int ret;

ret = nvme_nbft_read(ctx, &nbft, filename);
ret = nvme_read_nbft(ctx, &nbft, filename);
if (ret) {
Py_RETURN_NONE;
}

output = nbft_to_pydict(nbft);
nvme_nbft_free(ctx, nbft);
nvme_free_nbft(ctx, nbft);
return output;
}
%};
Expand Down
45 changes: 19 additions & 26 deletions libnvme/src/libnvme.ld
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LIBNVME_3 {
nvme_close;
nvme_create_ctrl;
nvme_create_global_ctx;
nvme_ctrl_config_match;
nvme_ctrl_match_config;
nvme_ctrl_first_ns;
nvme_ctrl_first_path;
nvme_ctrl_get_address;
Expand All @@ -25,9 +25,9 @@ LIBNVME_3 {
nvme_ctrl_next_ns;
nvme_ctrl_next_path;
nvme_ctrl_release_transport_handle;
nvme_ctrl_reset;
nvme_reset_ctrl;
nvme_ctrl_set_dhchap_host_key;
nvme_ctrls_filter;
nvme_filter_ctrls;
nvme_describe_key_serial;
nvme_disconnect_ctrl;
nvme_dump_config;
Expand All @@ -42,7 +42,6 @@ LIBNVME_3 {
nvme_free_host;
nvme_free_ns;
nvme_free_subsystem;
nvme_fw_download_seq;
nvme_gen_dhchap_key;
nvme_generate_tls_key_identity;
nvme_generate_tls_key_identity_compat;
Expand All @@ -69,26 +68,20 @@ LIBNVME_3 {
nvme_get_telemetry_max;
nvme_get_uuid_list;
nvme_get_version;
nvme_host_get;
nvme_get_host;
nvme_host_get_global_ctx;
nvme_host_get_ids;
nvme_host_is_pdc_enabled;
nvme_host_release_fds;
nvme_host_set_pdc_enabled;
nvme_hostid_from_file;
nvme_hostid_generate;
nvme_hostnqn_from_file;
nvme_hostnqn_generate;
nvme_hostnqn_generate_from_hostid;
nvme_read_hostid;
nvme_generate_hostid;
nvme_read_hostnqn;
nvme_generate_hostnqn;
nvme_generate_hostnqn_from_hostid;
nvme_import_tls_key;
nvme_import_tls_key_versioned;
nvme_init_copy_range;
nvme_init_copy_range_f1;
nvme_init_copy_range_f2;
nvme_init_copy_range_f3;
nvme_init_ctrl;
nvme_init_ctrl_list;
nvme_init_dsm_range;
nvme_insert_tls_key;
nvme_insert_tls_key_compat;
nvme_insert_tls_key_versioned;
Expand Down Expand Up @@ -130,11 +123,11 @@ LIBNVME_3 {
nvme_mi_submit_exit;
nvme_namespace_attach_ctrls;
nvme_namespace_detach_ctrls;
nvme_namespace_filter;
nvme_filter_namespace;
nvme_namespace_first_path;
nvme_namespace_next_path;
nvme_nbft_free;
nvme_nbft_read;
nvme_free_nbft;
nvme_read_nbft;
nvme_next_host;
nvme_next_subsystem;
nvme_ns_attach;
Expand All @@ -152,7 +145,7 @@ LIBNVME_3 {
nvme_ns_get_uuid;
nvme_ns_identify;
nvme_ns_read;
nvme_ns_rescan;
nvme_rescan_ns;
nvme_ns_verify;
nvme_ns_write;
nvme_ns_write_uncorrectable;
Expand All @@ -162,7 +155,7 @@ LIBNVME_3 {
nvme_path_get_ctrl;
nvme_path_get_ns;
nvme_path_get_queue_depth;
nvme_paths_filter;
nvme_filter_paths;
nvme_read_config;
nvme_read_key;
nvme_refresh_topology;
Expand Down Expand Up @@ -193,10 +186,10 @@ LIBNVME_3 {
nvme_strerror;
nvme_submit_admin_passthru;
nvme_submit_io_passthru;
nvme_subsys_filter;
nvme_filter_subsys;
nvme_subsystem_first_ctrl;
nvme_subsystem_first_ns;
nvme_subsystem_get;
nvme_get_subsystem;
nvme_subsystem_get_fw_rev;
nvme_subsystem_get_host;
nvme_subsystem_get_nqn;
Expand All @@ -205,7 +198,7 @@ LIBNVME_3 {
nvme_subsystem_next_ctrl;
nvme_subsystem_next_ns;
nvme_subsystem_release_fds;
nvme_subsystem_reset;
nvme_reset_subsystem;
nvme_transport_handle_get_fd;
nvme_transport_handle_get_name;
nvme_transport_handle_is_blkdev;
Expand All @@ -217,9 +210,9 @@ LIBNVME_3 {
nvme_transport_handle_set_submit_exit;
nvme_unlink_ctrl;
nvme_update_key;
nvme_uuid_find;
nvme_find_uuid;
nvme_uuid_from_string;
nvme_uuid_random;
nvme_random_uuid;
nvme_uuid_to_string;
local:
*;
Expand Down
4 changes: 4 additions & 0 deletions libnvme/src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ if want_fabrics
]
endif

if liburing_dep.found()
sources += 'nvme/uring.c'
endif

if json_c_dep.found()
sources += 'nvme/json.c'
else
Expand Down
Loading