scsi passthrough differs between guests

Peter Krempa pkrempa at redhat.com
Thu Oct 15 11:01:33 UTC 2020


On Thu, Oct 15, 2020 at 12:36:08 +0200, daggs wrote:
> Greetings Peter,
> 
> > Sent: Thursday, October 15, 2020 at 9:52 AM
> > From: "Peter Krempa" <pkrempa at redhat.com>
> > To: "daggs" <daggs at gmx.com>
> > Cc: "libvirt-usersredhat.com" <libvirt-users at redhat.com>
> > Subject: Re: scsi passthrough differs between guests
> >
> > I don't see anything wrong with you configs. There were some changes
> > related to SCSI hostdevs, between 6.7.0 an 6.8.0, but none of them
> > should actually impact that use case.
> >
> > Said that, could you please post the actual qemu command lines that
> > libvirt formatted for the two VMs you mention above.
> >
> > The command line can be found in /var/log/libvirt/qemu/$VMNAME.log .
> > Please make sure you post the latest/actual one. It'll help showing
> > whether anything changed between the two or there is a different
> > problem.
> >
> 
> here is the good cmd:
> /usr/bin/qemu-system-x86_64 \

[...]

> -drive file=/dev/sg5,if=none,format=raw,id=drive-hostdev0,readonly=on \
> -device scsi-generic,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-hostdev0,id=hostdev0 \

[...]

> the bad one:
> /usr/bin/qemu-system-x86_64 \

[...]

> -blockdev '{"driver":"host_device","filename":"/dev/sg0","node-name":"libvirt-hostdev0-backend","read-only":true}' \
> -device scsi-generic,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=libvirt-hostdev0-backend,id=hostdev0 \

This doesn't corelate with the version numbers you've mentioned, because
the "new" syntax which uses -blockdev was present both in 6.7.0 and
6.8.0.

Anyways the problem is almost certainly that the hostdev code doesn't
detect that it's a cdrom. We have such a hack in the disk code which
turns a 'host_device' into a 'host_cdrom'. I'll try fixing it but I
don't have a machine with a cdrom handy, so it would be nice if you
could test it afterwards.

Thanks for the report.




More information about the libvirt-users mailing list