vhost_scsi: fixed unsafe type conversion from vdev to svdev
A vhost_dev had been explicitly converted to vhost_scsi_dev in a following manner: vhost_dev* -> void* -> vhost_scsi_dev* Change-Id: Idfd4307bfea7385d71e67f140554dfc2e86447b5 Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com> Reviewed-on: https://review.gerrithub.io/367310 Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
3c497395cc
commit
5160ffaff5
@ -862,14 +862,14 @@ spdk_vhost_scsi_controller_construct(void)
|
||||
static int
|
||||
new_device(int vid)
|
||||
{
|
||||
struct spdk_vhost_dev *vdev = NULL;
|
||||
struct spdk_vhost_scsi_dev *svdev = NULL;
|
||||
|
||||
vdev = spdk_vhost_dev_load(vid);
|
||||
if (vdev == NULL) {
|
||||
svdev = to_scsi_dev(spdk_vhost_dev_load(vid));
|
||||
if (svdev == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
spdk_vhost_timed_event_send(vdev->lcore, add_vdev_cb, vdev, 1, "add scsi vdev");
|
||||
spdk_vhost_timed_event_send(svdev->vdev.lcore, add_vdev_cb, svdev, 1, "add scsi vdev");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user