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
1 change: 1 addition & 0 deletions src/libnvme.map
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
LIBNVME_UNRELEASED {
global:
nvme_get_uuid_list;
nvme_set_etdas;
nvme_clear_etdas;
nvme_insert_tls_key_compat;
Expand Down
18 changes: 18 additions & 0 deletions src/nvme/linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,24 @@ int nvme_clear_etdas(int fd, bool *changed)
return 0;
}

int nvme_get_uuid_list(int fd, struct nvme_id_uuid_list *uuid_list)
{
int err;
struct nvme_id_ctrl ctrl;

memset(&ctrl, 0, sizeof(struct nvme_id_ctrl));
err = nvme_identify_ctrl(fd, &ctrl);
if (err) {
fprintf(stderr, "ERROR: nvme_identify_ctrl() failed 0x%x\n", err);
return err;
}

if ((ctrl.ctratt & NVME_CTRL_CTRATT_UUID_LIST) == NVME_CTRL_CTRATT_UUID_LIST)
err = nvme_identify_uuid(fd, uuid_list);

return err;
}

int nvme_get_telemetry_max(int fd, enum nvme_telemetry_da *da, size_t *data_tx)
{
_cleanup_free_ struct nvme_id_ctrl *id_ctrl = NULL;
Expand Down
11 changes: 11 additions & 0 deletions src/nvme/linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,17 @@ int nvme_set_etdas(int fd, bool *changed);
*/
int nvme_clear_etdas(int fd, bool *changed);

/**
* nvme_get_uuid_list - Returns the uuid list (if supported)
* @fd: File descriptor of nvme device
* @uuid_list: UUID list returned by identify UUID
*
* Return: The nvme command status if a response was received (see
* &enum nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_uuid_list(int fd,
struct nvme_id_uuid_list *uuid_list);

/**
* nvme_get_telemetry_max() - Get telemetry limits
* @fd: File descriptor of nvme device
Expand Down