From d1da24769f6498d5c5f7380502596347f6523fae Mon Sep 17 00:00:00 2001 From: Dariusz Stojaczyk Date: Wed, 3 Jan 2018 15:20:42 +0100 Subject: [PATCH] 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 Reviewed-on: https://review.gerrithub.io/371864 Reviewed-by: Pawel Wodkowski Reviewed-by: Daniel Verkamp Reviewed-by: Ben Walker Reviewed-by: Jim Harris Tested-by: SPDK Automated Test System --- lib/vhost/vhost_scsi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/vhost/vhost_scsi.c b/lib/vhost/vhost_scsi.c index 925717318..963fb3e6a 100644 --- a/lib/vhost/vhost_scsi.c +++ b/lib/vhost/vhost_scsi.c @@ -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; }