lib/nvme: add trstring comparison to trid comparison.

Multiple custom transport types could share the same trtype variable. Add this additional check to compare them.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: Ief93d0d82aee754c9235cbab3c55827e57869fe9
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478748
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Seth Howell 2019-12-23 14:46:06 -07:00 committed by Tomasz Zawadzki
parent a050dcf21d
commit d4ea320bb5

View File

@ -1042,7 +1042,12 @@ spdk_nvme_transport_id_compare(const struct spdk_nvme_transport_id *trid1,
{
int cmp;
cmp = cmp_int(trid1->trtype, trid2->trtype);
if (trid1->trtype == SPDK_NVME_TRANSPORT_CUSTOM) {
cmp = strcasecmp(trid1->trstring, trid2->trstring);
} else {
cmp = cmp_int(trid1->trtype, trid2->trtype);
}
if (cmp) {
return cmp;
}