From b7b747eab1ede71d525758d759c6c77c3010d131 Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Thu, 28 Jul 2016 13:38:05 -0700 Subject: [PATCH] nvmf: Correctly handle multiple wildcard NVMe directives. Change-Id: Ie0c4a76734f1f0c4b87c7a752fe68627892a93b9 Signed-off-by: Ben Walker --- lib/nvmf/conf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/nvmf/conf.c b/lib/nvmf/conf.c index 95115acf5..f9d3484d0 100644 --- a/lib/nvmf/conf.c +++ b/lib/nvmf/conf.c @@ -54,6 +54,7 @@ struct spdk_nvmf_probe_ctx { struct spdk_nvmf_subsystem *subsystem; bool any; + bool found; int domain; int bus; int device; @@ -270,7 +271,8 @@ probe_cb(void *cb_ctx, struct spdk_pci_device *dev, struct spdk_nvme_ctrlr_opts SPDK_NOTICELOG("Probing device %x:%x:%x.%x\n", found_domain, found_bus, found_dev, found_func); - if (ctx->any) { + if (ctx->any && !ctx->found) { + ctx->found = true; return true; } @@ -449,6 +451,7 @@ spdk_nvmf_parse_subsystem(struct spdk_conf_section *sp) } ctx.subsystem = subsystem; + ctx.found = false; if (strcmp(bdf, "*") == 0) { ctx.any = true; } else {