Commit 9f597055 authored by Daniel Verkamp's avatar Daniel Verkamp Committed by Jim Harris
Browse files

nvmf: use "nqn" rather than "subnqn" in RPC param



This fixes the new nvmf_subsystem_add_listener RPC method to use "nqn"
as the parameter name to be consistent with the other NVMe-oF target RPC
methods.

Since this method is brand new, no provision for compatibility with the
old name is provided.

Fixes: 6336217e ("nvmf: Add rpc to add listeners to subsystems")
Change-Id: I86263fb1c53ed6ab48fe70917686d78a4a7ce28d
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/398870


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
parent 9ee661b4
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -542,7 +542,7 @@ invalid:
SPDK_RPC_REGISTER("delete_nvmf_subsystem", spdk_rpc_delete_nvmf_subsystem)

struct nvmf_rpc_listener_ctx {
	char				*subnqn;
	char				*nqn;
	struct rpc_listen_address	address;

	struct spdk_jsonrpc_request	*request;
@@ -551,14 +551,14 @@ struct nvmf_rpc_listener_ctx {
};

static const struct spdk_json_object_decoder nvmf_rpc_listener_decoder[] = {
	{"subnqn", offsetof(struct nvmf_rpc_listener_ctx, subnqn), spdk_json_decode_string},
	{"nqn", offsetof(struct nvmf_rpc_listener_ctx, nqn), spdk_json_decode_string},
	{"listen_address", offsetof(struct nvmf_rpc_listener_ctx, address), decode_rpc_listen_address},
};

static void
nvmf_rpc_listener_ctx_free(struct nvmf_rpc_listener_ctx *ctx)
{
	free(ctx->subnqn);
	free(ctx->nqn);
	free_rpc_listen_address(&ctx->address);
	free(ctx);
}
@@ -646,9 +646,9 @@ nvmf_rpc_subsystem_add_listener(struct spdk_jsonrpc_request *request,
		return;
	}

	subsystem = spdk_nvmf_tgt_find_subsystem(g_tgt.tgt, ctx->subnqn);
	subsystem = spdk_nvmf_tgt_find_subsystem(g_tgt.tgt, ctx->nqn);
	if (!subsystem) {
		SPDK_ERRLOG("Unable to find subsystem with NQN %s\n", ctx->subnqn);
		SPDK_ERRLOG("Unable to find subsystem with NQN %s\n", ctx->nqn);
		spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS, "Invalid parameters");
		nvmf_rpc_listener_ctx_free(ctx);
		return;
+2 −2
Original line number Diff line number Diff line
@@ -351,7 +351,7 @@ Add a new listen address to an NVMe-oF subsystem.

Name                    | Optional | Type        | Description
----------------------- | -------- | ----------- | -----------
subnqn                  | Required | string      | Subsystem NQN
nqn                     | Required | string      | Subsystem NQN
listen_address          | Required | object      | @ref rpc_construct_nvmf_subsystem_listen_address object

### Example
@@ -364,7 +364,7 @@ Example request:
  "id": 1,
  "method": "nvmf_subsystem_add_listener",
  "params": {
    "subnqn": "nqn.2016-06.io.spdk:cnode1",
    "nqn": "nqn.2016-06.io.spdk:cnode1",
    "listen_address": {
      "trtype": "RDMA",
      "adrfam": "IPv4",
+1 −1
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ def nvmf_subsystem_add_listener(args):
    if args.adrfam:
        listen_address['adrfam'] = args.adrfam

    params = {'subnqn': args.nqn,
    params = {'nqn': args.nqn,
              'listen_address': listen_address}

    args.client.call('nvmf_subsystem_add_listener', params)