Skip to content

Commit f5b985f

Browse files
shroffniigaw
authored andcommitted
nvme: add iopolicy field in JSON output
Commit d0b4c6c (“nvme: extend show-topology command to add support for multipath”) extended the show-topology command output and added the iopolicy field to the subsystem header in the text output even when show-topology command is executed in non-verbose mode. However, the iopolicy field was not included in the JSON output, (for non-verbose output) resulting in an inconsistency between the text and JSON formats. This change fixes that by adding the iopolicy field to the JSON output when the show-topology command is executed with the JSON output format. Fixes: d0b4c6c ("nvme: extend show-topology command to add support for multipath") Signed-off-by: Nilay Shroff <[email protected]> Reviewed-by: Martin George <[email protected]> Reviewed-by: Chaitanya Kulkarni <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Daniel Wagner <[email protected]>
1 parent 230bc9d commit f5b985f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

nvme-print-json.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4851,6 +4851,8 @@ static void json_simple_topology(struct nvme_global_ctx *ctx)
48514851
subsystem_attrs = json_create_object();
48524852
obj_add_str(subsystem_attrs, "Name", nvme_subsystem_get_name(s));
48534853
obj_add_str(subsystem_attrs, "NQN", nvme_subsystem_get_nqn(s));
4854+
obj_add_str(subsystem_attrs, "IOPolicy",
4855+
nvme_subsystem_get_iopolicy(s));
48544856

48554857
if (verbose_mode()) {
48564858
obj_add_str(subsystem_attrs, "Model",
@@ -4859,8 +4861,6 @@ static void json_simple_topology(struct nvme_global_ctx *ctx)
48594861
nvme_subsystem_get_serial(s));
48604862
obj_add_str(subsystem_attrs, "Firmware",
48614863
nvme_subsystem_get_fw_rev(s));
4862-
obj_add_str(subsystem_attrs, "IOPolicy",
4863-
nvme_subsystem_get_iopolicy(s));
48644864
obj_add_str(subsystem_attrs, "Type",
48654865
nvme_subsystem_get_type(s));
48664866
}

0 commit comments

Comments
 (0)