vhost: assign svdev from spdk thread context
Currently scsi sets it's svdev from the vhost thread context, while blk does it from the spdk thread context. Make scsi match what blk does, to make the code more consistent. This also will allow for an upcoming simplification. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: I609513bc8e05b49dd9455f2f61ba0cedc35236e6 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14326 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
parent
bb432b4eea
commit
f8df19a49f
@ -1355,11 +1355,15 @@ vhost_scsi_start_cb(struct spdk_vhost_dev *vdev,
|
||||
struct spdk_vhost_session *vsession, void *unused)
|
||||
{
|
||||
struct spdk_vhost_scsi_session *svsession = to_scsi_session(vsession);
|
||||
struct spdk_vhost_scsi_dev *svdev = svsession->svdev;
|
||||
struct spdk_vhost_scsi_dev *svdev;
|
||||
struct spdk_scsi_dev_vhost_state *state;
|
||||
uint32_t i;
|
||||
int rc;
|
||||
|
||||
svdev = to_scsi_dev(vsession->vdev);
|
||||
assert(svdev != NULL);
|
||||
svsession->svdev = svdev;
|
||||
|
||||
/* validate all I/O queues are in a contiguous index range */
|
||||
for (i = VIRTIO_SCSI_REQUESTQ; i < vsession->max_queues; i++) {
|
||||
if (vsession->virtqueue[i].vring.desc == NULL) {
|
||||
@ -1411,13 +1415,6 @@ out:
|
||||
static int
|
||||
vhost_scsi_start(struct spdk_vhost_session *vsession)
|
||||
{
|
||||
struct spdk_vhost_scsi_session *svsession = to_scsi_session(vsession);
|
||||
struct spdk_vhost_scsi_dev *svdev;
|
||||
|
||||
svdev = to_scsi_dev(vsession->vdev);
|
||||
assert(svdev != NULL);
|
||||
svsession->svdev = svdev;
|
||||
|
||||
return vhost_user_session_send_event(vsession, vhost_scsi_start_cb,
|
||||
3, "start session");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user