Skip to content

Commit c3bb861

Browse files
martin-gpyigaw
authored andcommitted
tree: add routine to fetch subsys model
Add a new routine to fetch the subsystem model. Signed-off-by: Martin George <[email protected]>
1 parent 05a804d commit c3bb861

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

src/libnvme.map

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# SPDX-License-Identifier: LGPL-2.1-or-later
2+
LIBNVME_1.13 {
3+
global:
4+
nvme_subsystem_get_model;
5+
};
6+
27
LIBNVME_1.12 {
38
global:
49
nvme_lm_cdq;

src/nvme/tree.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,11 @@ const char *nvme_subsystem_get_iopolicy(nvme_subsystem_t s)
527527
return s->iopolicy;
528528
}
529529

530+
const char *nvme_subsystem_get_model(nvme_subsystem_t s)
531+
{
532+
return s->model;
533+
}
534+
530535
nvme_ctrl_t nvme_subsystem_first_ctrl(nvme_subsystem_t s)
531536
{
532537
return list_top(&s->ctrls, struct nvme_ctrl, entry);

src/nvme/tree.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,6 +1346,14 @@ void nvme_subsystem_set_application(nvme_subsystem_t s, const char *a);
13461346
*/
13471347
const char *nvme_subsystem_get_iopolicy(nvme_subsystem_t s);
13481348

1349+
/**
1350+
* nvme_subsystem_get_model() - Return the model of subsystem
1351+
* @s: nvme_subsystem_t object
1352+
*
1353+
* Return: Model of the current subsystem
1354+
*/
1355+
const char *nvme_subsystem_get_model(nvme_subsystem_t s);
1356+
13491357
/**
13501358
* nvme_scan_topology() - Scan NVMe topology and apply filter
13511359
* @r: nvme_root_t object

0 commit comments

Comments
 (0)