Skip to content

Commit

Permalink
nvme-print: expand the maximum field length to prevent misalignment
Browse files Browse the repository at this point in the history
Fields like Generic and Device are longer for SPDK-controlled
devices, which causes misalignment.

Signed-off-by: Sebastian Brzezinka <[email protected]>
Signed-off-by: Daniel Wagner <[email protected]>
  • Loading branch information
sberbz authored and igaw committed May 3, 2024
1 parent 38d6868 commit b32a79c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nvme-print-stdout.c
Original file line number Diff line number Diff line change
Expand Up @@ -4870,17 +4870,17 @@ static void stdout_detailed_list(nvme_root_t r)
strset_iterate(&res.subsystems, stdout_detailed_subsys, &res);
printf("\n");

printf("%-8s %-6s %-20s %-40s %-8s %-6s %-14s %-6s %-12s %-16s\n", "Device",
printf("%-16s %-5s %-20s %-40s %-8s %-6s %-14s %-6s %-12s %-16s\n", "Device",
"Cntlid", "SN", "MN", "FR", "TxPort", "Address", "Slot", "Subsystem",
"Namespaces");
printf("%-.8s %-.6s %-.20s %-.40s %-.8s %-.6s %-.14s %-.6s %-.12s %-.16s\n",
printf("%-.16s %-.6s %-.20s %-.40s %-.8s %-.6s %-.14s %-.6s %-.12s %-.16s\n",
dash, dash, dash, dash, dash, dash, dash, dash, dash, dash);
strset_iterate(&res.ctrls, stdout_detailed_ctrl, &res);
printf("\n");

printf("%-12s %-12s %-10s %-26s %-16s %-16s\n", "Device", "Generic",
printf("%-17s %-17s %-10s %-26s %-16s %-16s\n", "Device", "Generic",
"NSID", "Usage", "Format", "Controllers");
printf("%-.12s %-.12s %-.10s %-.26s %-.16s %-.16s\n", dash, dash, dash,
printf("%-.17s %-.17s %-.10s %-.26s %-.16s %-.16s\n", dash, dash, dash,
dash, dash, dash);
strset_iterate(&res.namespaces, stdout_detailed_ns, &res);

Expand Down

0 comments on commit b32a79c

Please sign in to comment.