Greetings Peter,
Sent: Thursday, October 15, 2020 at 2:01 PM
From: "Peter Krempa" <pkrempa(a)redhat.com>
To: "daggs" <daggs(a)gmx.com>
Cc: "libvirt-usersredhat.com" <libvirt-users(a)redhat.com>
Subject: Re: scsi passthrough differs between guests
[...]
> -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.
the "good" syntax was created with libvirt of version which is
earlier than 6.7, libvirt was upgraded several times since the vm creation.
I don't know if the syntax is changed every version or not.
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.
my system is gentoo, hence, every pkg is compiled, if you provide a patch, I can test it
easily.
Thanks for the effort,
Dagg.