Commit 0cedafeb authored by tanlong's avatar tanlong Committed by Jim Harris
Browse files

bdev/nvme:Print multiple namespace attributes of nvme bdev in bdev_get_bdevs



Current code only print the last namespace of nvme bdev, fix the print
way to show all the namespace.

And this patch will be prepared for the next patch to show io path status for multipath, like: which one is the primary or the backup, and the old status and current status,etc.

Signed-off-by: default avatartanlong <948985618@qq.com>
Change-Id: I4fca154df52c929b8d046198934db0e58586c378
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10140


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
parent 1421a35e
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1931,7 +1931,7 @@ nvme_namespace_info_json(struct spdk_json_write_ctx *w,
	trid = spdk_nvme_ctrlr_get_transport_id(ctrlr);
	vs = spdk_nvme_ctrlr_get_regs_vs(ctrlr);

	spdk_json_write_named_object_begin(w, "nvme");
	spdk_json_write_object_begin(w);

	if (trid->trtype == SPDK_NVME_TRANSPORT_PCIE) {
		spdk_json_write_named_string(w, "pci_address", trid->traddr);
@@ -2025,9 +2025,11 @@ bdev_nvme_dump_info_json(void *ctx, struct spdk_json_write_ctx *w)
	struct nvme_ns *nvme_ns;

	pthread_mutex_lock(&nvme_bdev->mutex);
	spdk_json_write_named_array_begin(w, "nvme");
	TAILQ_FOREACH(nvme_ns, &nvme_bdev->nvme_ns_list, tailq) {
		nvme_namespace_info_json(w, nvme_ns);
	}
	spdk_json_write_array_end(w);
	pthread_mutex_unlock(&nvme_bdev->mutex);

	return 0;