ut/bdev_nvme: Copy probe_ctx->opts to ctrlr->opts
In unit tests, spdk_nvme_ctrlr had opts but did not use it. Hostnqn will be checked to determine if multipath can be created. Hence we implement the stub spdk_nvme_ctrlr_get_default_ctrlr_opts() and copy probe_ctx->opts to ctrlr->opts as we do in lib/nvme. Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: I13980424d5f463877eae7f7cd1e5ffcae888aebe Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9333 Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Reviewed-by: Konrad Sztyber <konrad.sztyber@gmail.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
17d28590fd
commit
cf0dbbb924
@ -59,9 +59,6 @@ DEFINE_STUB(spdk_nvme_transport_id_trtype_str, const char *, (enum spdk_nvme_tra
|
||||
|
||||
DEFINE_STUB(spdk_nvme_transport_id_adrfam_str, const char *, (enum spdk_nvmf_adrfam adrfam), NULL);
|
||||
|
||||
DEFINE_STUB_V(spdk_nvme_ctrlr_get_default_ctrlr_opts, (struct spdk_nvme_ctrlr_opts *opts,
|
||||
size_t opts_size));
|
||||
|
||||
DEFINE_STUB(spdk_nvme_ctrlr_set_trid, int, (struct spdk_nvme_ctrlr *ctrlr,
|
||||
struct spdk_nvme_transport_id *trid), 0);
|
||||
|
||||
@ -500,6 +497,11 @@ nvme_ctrlr_poll_internal(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nvme_probe_c
|
||||
return;
|
||||
}
|
||||
|
||||
spdk_nvme_ctrlr_get_default_ctrlr_opts(&ctrlr->opts, sizeof(ctrlr->opts));
|
||||
if (probe_ctx->cb_ctx) {
|
||||
ctrlr->opts = *(struct spdk_nvme_ctrlr_opts *)probe_ctx->cb_ctx;
|
||||
}
|
||||
|
||||
TAILQ_INSERT_TAIL(&g_ut_attached_ctrlrs, ctrlr, tailq);
|
||||
|
||||
if (probe_ctx->attach_cb) {
|
||||
@ -558,6 +560,15 @@ spdk_nvme_detach(struct spdk_nvme_ctrlr *ctrlr)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
spdk_nvme_ctrlr_get_default_ctrlr_opts(struct spdk_nvme_ctrlr_opts *opts, size_t opts_size)
|
||||
{
|
||||
memset(opts, 0, opts_size);
|
||||
|
||||
snprintf(opts->hostnqn, sizeof(opts->hostnqn),
|
||||
"nqn.2014-08.org.nvmexpress:uuid:7391e776-0716-11ec-9a03-0242ac130003");
|
||||
}
|
||||
|
||||
const struct spdk_nvme_ctrlr_data *
|
||||
spdk_nvme_ctrlr_get_data(struct spdk_nvme_ctrlr *ctrlr)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user