vhost/nvme: fix vhost-nvme target with session feature
Existing specific vhost socket messages for vhost-nvme target will get some information from backend target before start_session call, so we should iterate the associated nvme controller by vid but not session. Fix issue #628. Change-Id: Ia400bf33895a0feee0058a870f26b0ff72b7556f Signed-off-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-on: https://review.gerrithub.io/c/442498 Reviewed-by: Ziye Yang <optimistyzy@gmail.com> Reviewed-by: Liang Yan <liang.z.yan@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
ec2e259402
commit
f2b480cc24
@ -894,10 +894,15 @@ static struct spdk_vhost_nvme_dev *
|
||||
spdk_vhost_nvme_get_by_name(int vid)
|
||||
{
|
||||
struct spdk_vhost_nvme_dev *nvme;
|
||||
struct spdk_vhost_dev *vdev;
|
||||
struct spdk_vhost_session *vsession;
|
||||
|
||||
TAILQ_FOREACH(nvme, &g_nvme_ctrlrs, tailq) {
|
||||
if (nvme->vsession != NULL && nvme->vsession->vid == vid) {
|
||||
return nvme;
|
||||
vdev = &nvme->vdev;
|
||||
TAILQ_FOREACH(vsession, &vdev->vsessions, tailq) {
|
||||
if (vsession->vid == vid) {
|
||||
return nvme;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1096,6 +1101,7 @@ spdk_vhost_nvme_start_cb(struct spdk_vhost_dev *vdev,
|
||||
}
|
||||
}
|
||||
|
||||
nvme->vsession = vsession;
|
||||
/* Start the NVMe Poller */
|
||||
nvme->requestq_poller = spdk_poller_register(nvme_worker, nvme, 0);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user