[libvirt] SCSI command passthrough

Geert Jansen gjansen at redhat.com
Thu Sep 6 16:51:08 UTC 2012


Hi,

i'm trying to pass through SCSI commands from a guest to a host. Both 
guest and host are RHEL 6.3. The relevant section in my XML is:

   <devices>
     <disk type='block' device='lun'>
       <driver name='qemu' type='raw' cache='none'/>
       <source dev='/dev/sdb'/>
       <target dev='sdb' bus='scsi'/>
       <address type='drive' controller='0' bus='0' target='1' unit='0'/>
     </disk>
     <controller type='scsi' index='0' model='virtio-scsi'>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x05' 
function='0x0'/>
     </controller>
   ...
   </devices>

Commands that are whitelisted by the host kernel come through (e.g. 
"sg_inq"), but other commands don't (e.g. "sg_persist").

I need sg_persist so i tried making qemu-kvm setuid root. This works.

Is there a better way to allow arbitrary SCSI commands, perferably on a 
per-VM basis, rather than making qemu setuid root?

Regards,
Geert




More information about the libvir-list mailing list