Is there a method which can tell a SCSI device is valid or not

Hongjiang Zhang honzhan at microsoft.com
Tue Dec 15 08:49:09 UTC 2015


I'd like to know whether there is a utility method which can tell a scsi device is perfectly installed or not. Is there a method like "is_scsi_installed(struct scsi_inquiry_data *)"?

Background:
When I developed storage drivers for hyper-v on windows 10, I found in the windows host tells VM some of the devices status are ok, but in fact such device did not have valid information.
For example, "Fixed Uninstalled SPC-3 SCSI device (LUN not supported)" if I print its inq_data.

The following code is used to print the inquire data:

struct scsi_inquiry_data *inq_data = &(ccb->ccb_h.path->device->inq_data);
scsi_print_inquiry(inq_data);

The log I collected:

Dec 15 11:19:33 honzhan-dev2 kernel: <Msft Virtual Disk 1.0> Fixed Uninstalled SPC-3 SCSI device (LUN not supported)
Dec 15 11:19:33 honzhan-dev2 kernel: HV_DEBUG: VMBUS **SCSI_STATUS_OK with invalid SCSI
Dec 15 11:19:33 honzhan-dev2 kernel: HV_DEBUG: VMBUS 18: hv_storvsc_on_iocompletion type=0x1f, SPC-3 target=1, lun=0
Dec 15 11:19:33 honzhan-dev2 kernel: <Msft Virtual Disk 1.0> Fixed Uninstalled SPC-3 SCSI device (LUN not supported)
Dec 15 11:19:33 honzhan-dev2 kernel: HV_DEBUG: VMBUS **SCSI_STATUS_OK with invalid SCSI
Dec 15 11:19:33 honzhan-dev2 kernel: HV_DEBUG: VMBUS create_storvsc_request probe:0 storvsc:1:0 0:0
Dec 15 11:19:33 honzhan-dev2 kernel: <Msft Virtual Disk 1.0> Fixed Uninstalled SPC-3 SCSI device (LUN not supported)
Dec 15 11:19:33 honzhan-dev2 kernel: HV_DEBUG: VMBUS XPT_SCSI_IO device->lun_id=ffffffff
Dec 15 11:19:33 honzhan-dev2 kernel: HV_DEBUG: VMBUS create_storvsc_request probe:1 storvsc:1:0 1:0
Dec 15 11:19:33 honzhan-dev2 kernel: <Msft Virtual Disk 1.0> Fixed Uninstalled SPC-3 SCSI device (LUN not supported)



More information about the freebsd-scsi mailing list