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

Change-Id: Icdb017d7e6b0a38f8ff3aa78ea60117936dfe178
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/366702
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Ziye Yang 2017-06-23 07:54:04 +08:00 committed by Jim Harris
parent b5e9e92934
commit a9428cb39e

View File

@ -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,13 +970,17 @@ bdev_nvme_library_init(void)
rc = -1;
goto end;
}
} else {
local_nvme_num++;
}
}
/* used to probe local NVMe device */
if (spdk_nvme_probe(NULL, probe_ctx, probe_cb, attach_cb, NULL)) {
rc = -1;
goto end;
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) {