Skip to content

Commit e6d61b8

Browse files
martin-gpyigaw
authored andcommitted
nvme-print: update subsys verbose outputs
The current list-subsys & show-topology simple outputs are a little crowded. Also the respective verbose options to both these commands are a no-op at the moment. So move the iopolicy and subsystype details to the respective verbose outputs instead so that the simple outputs are restricted to displaying key subsys details like subsys name & NQN alone. Signed-off-by: Martin George <marting@netapp.com>
1 parent 6c7bc6a commit e6d61b8

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

nvme-print-json.c

+14-4
Original file line numberDiff line numberDiff line change
@@ -2465,8 +2465,13 @@ static void json_print_nvme_subsystem_list(nvme_root_t r, bool show_ana)
24652465
subsystem_attrs = json_create_object();
24662466
obj_add_str(subsystem_attrs, "Name", nvme_subsystem_get_name(s));
24672467
obj_add_str(subsystem_attrs, "NQN", nvme_subsystem_get_nqn(s));
2468-
obj_add_str(subsystem_attrs, "IOPolicy", nvme_subsystem_get_iopolicy(s));
2469-
obj_add_str(subsystem_attrs, "Type", nvme_subsystem_get_type(s));
2468+
2469+
if (json_print_ops.flags & VERBOSE) {
2470+
obj_add_str(subsystem_attrs, "IOPolicy",
2471+
nvme_subsystem_get_iopolicy(s));
2472+
obj_add_str(subsystem_attrs, "Type",
2473+
nvme_subsystem_get_type(s));
2474+
}
24702475

24712476
array_add_obj(subsystems, subsystem_attrs);
24722477
paths = json_create_array();
@@ -4360,8 +4365,13 @@ static void json_simple_topology(nvme_root_t r)
43604365
subsystem_attrs = json_create_object();
43614366
obj_add_str(subsystem_attrs, "Name", nvme_subsystem_get_name(s));
43624367
obj_add_str(subsystem_attrs, "NQN", nvme_subsystem_get_nqn(s));
4363-
obj_add_str(subsystem_attrs, "IOPolicy", nvme_subsystem_get_iopolicy(s));
4364-
obj_add_str(subsystem_attrs, "Type", nvme_subsystem_get_type(s));
4368+
4369+
if (json_print_ops.flags & VERBOSE) {
4370+
obj_add_str(subsystem_attrs, "IOPolicy",
4371+
nvme_subsystem_get_iopolicy(s));
4372+
obj_add_str(subsystem_attrs, "Type",
4373+
nvme_subsystem_get_type(s));
4374+
}
43654375

43664376
array_add_obj(subsystems, subsystem_attrs);
43674377
namespaces = json_create_array();

nvme-print-stdout.c

+7-4
Original file line numberDiff line numberDiff line change
@@ -1071,10 +1071,13 @@ static void stdout_subsys_config(nvme_subsystem_t s)
10711071
nvme_subsystem_get_nqn(s));
10721072
printf("%*s hostnqn=%s\n", len, " ",
10731073
nvme_host_get_hostnqn(nvme_subsystem_get_host(s)));
1074-
printf("%*s iopolicy=%s\n", len, " ",
1075-
nvme_subsystem_get_iopolicy(s));
1076-
printf("%*s type=%s\n", len, " ",
1077-
nvme_subsystem_get_type(s));
1074+
1075+
if (stdout_print_ops.flags & VERBOSE) {
1076+
printf("%*s iopolicy=%s\n", len, " ",
1077+
nvme_subsystem_get_iopolicy(s));
1078+
printf("%*s type=%s\n", len, " ",
1079+
nvme_subsystem_get_type(s));
1080+
}
10781081
}
10791082

10801083
static void stdout_subsystem(nvme_root_t r, bool show_ana)

0 commit comments

Comments
 (0)