Commit a9428cb3 authored by Ziye Yang's avatar Ziye Yang Committed by Jim Harris
Browse files

blockdev, nvme: do not probe local nvme device if not configured.



Change-Id: Icdb017d7e6b0a38f8ff3aa78ea60117936dfe178
Signed-off-by: default avatarZiye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/366702


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent b5e9e929
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -859,6 +859,7 @@ bdev_nvme_library_init(void)
	size_t i;
	struct nvme_probe_ctx *probe_ctx = NULL;
	int retry_count;
	uint32_t local_nvme_num = 0;

	sp = spdk_conf_find_section(NULL, "Nvme");
	if (sp == NULL) {
@@ -969,14 +970,18 @@ bdev_nvme_library_init(void)
				rc = -1;
				goto end;
			}
		} else {
			local_nvme_num++;
		}
	}

	if (local_nvme_num > 0) {
		/* used to probe local NVMe device */
		if (spdk_nvme_probe(NULL, probe_ctx, probe_cb, attach_cb, NULL)) {
			rc = -1;
			goto end;
		}
	}

	if (g_nvme_hotplug_enabled) {
		spdk_bdev_poller_start(&g_hotplug_poller, blockdev_nvme_hotplug, NULL,