vhost: don't check HOTPLUG feature flag when not necessary

LUN hotremove callback can be triggered when
it's vhost-scsi controller is not started
yet. In such case it is not necessary to check
against HOTPLUG flag (if the controller doesn't
have any driver connected yet, there might be
no negotiated flags whatsoever).

Change-Id: Ic7c78e3bdf45fa4d5628cd19c4c5ad723699e45f
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/371864
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
Dariusz Stojaczyk 2018-01-03 15:20:42 +01:00 committed by Daniel Verkamp
parent b3eff95f76
commit d1da24769f

View File

@ -750,7 +750,8 @@ spdk_vhost_scsi_lun_hotremove(const struct spdk_scsi_lun *lun, void *arg)
assert(lun != NULL);
assert(svdev != NULL);
if (!spdk_vhost_dev_has_feature(&svdev->vdev, VIRTIO_SCSI_F_HOTPLUG)) {
if (svdev->vdev.lcore != -1 &&
!spdk_vhost_dev_has_feature(&svdev->vdev, VIRTIO_SCSI_F_HOTPLUG)) {
SPDK_WARNLOG("%s: hotremove is not enabled for this controller.\n", svdev->vdev.name);
return;
}