scsi passthrough differs between guests

daggs
Wed, 14 Oct 2020 21:00:39 -0000

Greetings,

I have two machines running the same distro, both running qemu 5.1.0, one runs
libvirt 6.7.0, the other 6.8.0.
I've decided to test the viability of passing through my sata cdrom into a
vm, so I went to the libvirt docs, read a bit and added the following to a
debian10 uefi vm running on libvirt 6.8.0:
<controller type='scsi' index='0'
model='virtio-scsi'>
  <address type='pci' domain='0x0000' bus='0x07'
slot='0x00' function='0x0'/>
</controller>
<hostdev mode='subsystem' type='scsi'
managed='no'>

    <adapter name='scsi_host11'/>


  <readonly/>
  <address type='drive' controller='0' bus='0'
target='0' unit='0'/>
</hostdev>
I've booted the vm and saw the cdrom in the vm, eject worked and so did
mount.

I've decided to move it to another machine running libvirt 6.7.0, I've
verified the cdrom is visible on the new system, seE:
# lsscsi
[0:0:0:0]    cd/dvd  HL-DT-ST DVDRAM GH24NSD1  LW00  /dev/sr0

I've inserted the same xml into another vm running libreelec uefi but
changed the host from 11 to 0, it looks like this:
<controller type='scsi' index='0'
model='virtio-scsi'>
  <alias name='scsi0'/>
  <address type='pci' domain='0x0000' bus='0x02'
slot='0x01' function='0x0'/>
</controller>
<hostdev mode='subsystem' type='scsi'
managed='no'>

    <adapter name='scsi_host0'/>


  <readonly/>
  <alias name='hostdev0'/>
  <address type='drive' controller='0' bus='0'
target='0' unit='0'/>
</hostdev>

but when I boot the vm, I see no cdrom, lspci shows this:
03:00.0 SCSI storage controller: Red Hat, Inc. Virtio block device (rev 01)
07:01.0 SCSI storage controller: Red Hat, Inc. Virtio SCSI

as there is no lsscsi or /proc/scsi/scsi I cannot see other possible scsis.
I know for a fact that libreelec supports scsi/sata cdroms as it is a frequent
he for streamers.
I'm baffled about the two scsi controllers I see and why I cannot see the
device.
is there a known issue in 6.7.0 with scsi pass-trough?

Dagg.