1 Commits

Author SHA1 Message Date
Chen Qun
a55dd0838d virtio-scsi: bugfix: fix qemu crash for hotplug scsi disk with dataplane
The vm will trigger a disk sweep operation after plugging
a controller who's io type is iothread.  If attach a scsi
disk immediately, the sg_inqury request in vm will trigger
the assert in virtio_scsi_ctx_check(), which is called by
virtio_scsi_handle_cmd_req_prepare().

Add judgment in virtio_scsi_handle_cmd_req_prepare() and
return IO Error directly if the device has not been
initialized.

Signed-off-by: Jinhua Cao <caojinhua1@huawei.com>
2022-03-19 14:42:32 +08:00