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 <sebastian.brzezinka@intel.com>
Change-Id: Ice21003dba7cd63762249252c2de38cd6afca5fd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/nvme-cli/+/20997
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <jim.harris@samsung.com>
  • Loading branch information
sberbz authored and tomzawadzki committed Apr 10, 2024
1 parent ecce001 commit d7e8a03
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions nvme-print-stdout.c
Original file line number Diff line number Diff line change
Expand Up @@ -4862,21 +4862,21 @@ static void stdout_detailed_list(nvme_root_t r)

nvme_resources_init(r, &res);

printf("%-16s %-96s %-.16s\n", "Subsystem", "Subsystem-NQN", "Controllers");
printf("%-.16s %-.96s %-.16s\n", dash, dash, dash);
printf("%-15s %-96s %-.16s\n", "Subsystem", "Subsystem-NQN", "Controllers");
printf("%-.15s %-.96s %-.16s\n", dash, dash, dash);
strset_iterate(&res.subsystems, stdout_detailed_subsys, &res);
printf("\n");

printf("%-8s %-20s %-40s %-8s %-6s %-14s %-6s %-12s %-16s\n", "Device",
printf("%-15s %-20s %-40s %-8s %-6s %-14s %-6s %-12s %-16s\n", "Device",
"SN", "MN", "FR", "TxPort", "Asdress", "Slot", "Subsystem", "Namespaces");
printf("%-.8s %-.20s %-.40s %-.8s %-.6s %-.14s %-.6s %-.12s %-.16s\n", dash,
printf("%-.15s %-.20s %-.40s %-.8s %-.6s %-.14s %-.6s %-.12s %-.16s\n", 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 d7e8a03

Please sign in to comment.