
On Mon, Jan 28, 2019 at 09:50:41 +0100, Peter Krempa wrote:
On Fri, Jan 25, 2019 at 18:46:52 +0100, Kevin Wolf wrote:
The new device_id property specifies which value to use for the vendor specific designator in the Device Identification VPD page.
In particular, this is necessary for libvirt to maintain guest ABI compatibility when no serial number is given and a VM is switched from -drive (where the BlockBackend name is used) to -blockdev (where the vendor specific designator is left out by default).
Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- hw/scsi/scsi-disk.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-)
[...]
@@ -2904,7 +2910,9 @@ static const TypeInfo scsi_disk_base_info = { DEFINE_PROP_STRING("ver", SCSIDiskState, version), \ DEFINE_PROP_STRING("serial", SCSIDiskState, serial), \ DEFINE_PROP_STRING("vendor", SCSIDiskState, vendor), \ - DEFINE_PROP_STRING("product", SCSIDiskState, product) + DEFINE_PROP_STRING("product", SCSIDiskState, product), \ + DEFINE_PROP_STRING("device_id", SCSIDiskState, device_id)
This adds the property only to 'scsi-disk', whereas libvirt will use 'scsi-cd' or 'scsi-hd' depending on the media type if the 'scsi-cd' device is detected. The following logic decides:
https://libvirt.org/git/?p=libvirt.git;a=blob;f=src/qemu/qemu_command.c;h=3e...
This brings multiple questions:
I've found: commit b443ae67130d32ad06b06fc9aa6d04d05ccd93ce Author: Markus Armbruster <armbru@redhat.com> Date: Mon May 16 15:04:53 2011 +0200 scsi: Split qdev "scsi-disk" into "scsi-hd" and "scsi-cd" Which seems to put scsi-hd and scsi-cd as the thing to use. Libvirt's code obviously did not adapt after that and we still keep to probe scsi-disk instead of the split up devices, whereas we will never use scsi-disk. Also some of our tests seem to look as if scsi-disk was used which confused me. Since the new property is present also for scsi-hd and scsi-cd we really need to adapt our code to that. Btw, this also means that qemu can deprecate scsi-disk. Sorry for the noise.