On Wed, Mar 1, 2017 at 2:45 AM, Roman Kagan rkagan@virtuozzo.com wrote:
virtio_scsi_scan_target(struct pci_device *pci, struct vp_device *vp, struct vring_virtqueue *vq, u16 target) {
- /* TODO: send REPORT LUNS. For now, only LUN 0 is recognized. */
- int ret = virtio_scsi_add_lun(pci, vp, vq, target, 0);
- return ret < 0 ? 0 : 1;
- struct virtio_lun_s vlun0;
- virtio_scsi_init_lun(&vlun0, pci, vp, vq, target, 0);
- int ret = scsi_rep_luns_scan(&vlun0.drive, virtio_scsi_add_lun);
- return ret < 0 ? 0 : ret;
}
Yes, please! Just about 6 hours before you posted this, I noticed that when libvirt assigns addresses to virtio-scsi drives, it increments the LUN. My workaround--keeping LUN 0 and incrementing the target instead--can go away once this change is in SeaBIOS.
--Ed