Add identifier & NSID tags in the verbose output of the list-ns
command for better clarity. And while at it, print a common
"NVMe Namespace List" tag at the top too. For e.g.
nvme list-ns /dev/nvme1n1 -v
dev: /dev/nvme1n1, fd: 3
NVME Namespace List:
Identifier 0: NSID 0x1
Identifier 1: NSID 0x2
...
Signed-off-by: Martin George <marting@netapp.com>
static void stdout_list_ns(struct nvme_ns_list *ns_list)
{
- int i;
+ int i, verbose = stdout_print_ops.flags & VERBOSE;
+ printf("NVME Namespace List:\n");
for (i = 0; i < 1024; i++) {
- if (ns_list->ns[i])
- printf("[%4u]:%#x\n", i, le32_to_cpu(ns_list->ns[i]));
+ if (ns_list->ns[i]) {
+ if (verbose)
+ printf("Identifier %4u: NSID %#x\n",
+ i, le32_to_cpu(ns_list->ns[i]));
+ else
+ printf("[%4u]:%#x\n",
+ i, le32_to_cpu(ns_list->ns[i]));
+ }
}
}
return -EINVAL;
}
+ if (argconfig_parse_seen(opts, "verbose"))
+ flags |= VERBOSE;
+
ns_list = nvme_alloc(sizeof(*ns_list));
if (!ns_list)
return -ENOMEM;