From ae2ea6474000261a3d7c7d647c014496e8c320ef Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Mon, 30 Aug 2021 12:46:09 -0700 Subject: [PATCH] bdev/nvme: Report host parameters when listing controllers via RPC Change-Id: Ia3a73d63fd0e8b2eee29be4dc7ea8736f2ffb6ab Signed-off-by: Ben Walker Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9339 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Paul Luse Reviewed-by: Changpeng Liu Reviewed-by: Tomasz Zawadzki --- module/bdev/nvme/bdev_nvme_rpc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/module/bdev/nvme/bdev_nvme_rpc.c b/module/bdev/nvme/bdev_nvme_rpc.c index f033cda1e..e2f00fff3 100644 --- a/module/bdev/nvme/bdev_nvme_rpc.c +++ b/module/bdev/nvme/bdev_nvme_rpc.c @@ -427,6 +427,7 @@ rpc_dump_nvme_controller_info(struct nvme_ctrlr *nvme_ctrlr, void *ctx) { struct spdk_json_write_ctx *w = ctx; struct spdk_nvme_transport_id *trid; + const struct spdk_nvme_ctrlr_opts *opts; trid = nvme_ctrlr->connected_trid; @@ -447,6 +448,13 @@ rpc_dump_nvme_controller_info(struct nvme_ctrlr *nvme_ctrlr, void *ctx) nvme_bdev_dump_trid_json(trid, w); spdk_json_write_object_end(w); + opts = spdk_nvme_ctrlr_get_opts(nvme_ctrlr->ctrlr); + + spdk_json_write_named_object_begin(w, "host"); + spdk_json_write_named_string(w, "nqn", opts->hostnqn); + spdk_json_write_named_string(w, "addr", opts->src_addr); + spdk_json_write_named_string(w, "svcid", opts->src_svcid); + spdk_json_write_object_end(w); spdk_json_write_object_end(w); }