Commit 70db9e5c authored by GangCao's avatar GangCao Committed by Tomasz Zawadzki
Browse files

bdev/nvme: allow the nvme opts set when no nvme bdev configured



In the case that there is no NVMe bdev configured and RPC is
running, it shall still allow the NVMe options set. Once there
is one NVMe bdev configured, it will not allow the NVMe options
set.

Change-Id: Ib6a527174137a5d4df7babe206d2527e600500c0
Signed-off-by: default avatarGangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/479489


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
parent d31eb732
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1445,7 +1445,7 @@ Example response:

## bdev_nvme_set_options {#rpc_bdev_nvme_set_options}

Set global parameters for all bdev NVMe. This RPC may only be called before SPDK subsystems have been initialized.
Set global parameters for all bdev NVMe. This RPC may only be called before SPDK subsystems have been initialized or any bdev NVMe has been created.

### Parameters

+3 −1
Original line number Diff line number Diff line
@@ -1351,8 +1351,10 @@ int
spdk_bdev_nvme_set_opts(const struct spdk_bdev_nvme_opts *opts)
{
	if (g_bdev_nvme_init_thread != NULL) {
		if (!TAILQ_EMPTY(&g_nvme_bdev_ctrlrs)) {
			return -EPERM;
		}
	}

	g_opts = *opts;

+2 −1
Original line number Diff line number Diff line
@@ -115,7 +115,8 @@ spdk_rpc_bdev_nvme_set_options(struct spdk_jsonrpc_request *request,

	return;
}
SPDK_RPC_REGISTER("bdev_nvme_set_options", spdk_rpc_bdev_nvme_set_options, SPDK_RPC_STARTUP)
SPDK_RPC_REGISTER("bdev_nvme_set_options", spdk_rpc_bdev_nvme_set_options,
		  SPDK_RPC_STARTUP | SPDK_RPC_RUNTIME)
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(bdev_nvme_set_options, set_bdev_nvme_options)

struct rpc_bdev_nvme_hotplug {