qemu: command: Always assume support for QEMU_CAPS_SCSI_DISK_DEVICE_ID

The 'device_id' property of 'scsi_disk' was added in qemu-4.0 and it's
unconditionally present, thus we can now always assume its presence.

Update some fake-caps test which didn't yet assert the capability.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2022-07-18 13:16:40 +02:00
parent 31556cf167
commit b51512f915
6 changed files with 11 additions and 13 deletions

View File

@ -2141,13 +2141,11 @@ qemuBuildDiskDeviceProps(const virDomainDef *def,
* disk serial was not set and the disk serial otherwise.
* To avoid a guest-visible regression we need to provide it
* ourselves especially for cases when -blockdev will be used */
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_DISK_DEVICE_ID)) {
if (disk->serial) {
scsiVPDDeviceId = g_strdup(disk->serial);
} else {
if (!(scsiVPDDeviceId = qemuAliasDiskDriveFromDisk(disk)))
return NULL;
}
if (disk->serial) {
scsiVPDDeviceId = g_strdup(disk->serial);
} else {
if (!(scsiVPDDeviceId = qemuAliasDiskDriveFromDisk(disk)))
return NULL;
}
}

View File

@ -36,7 +36,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-aarch64test/.config \
-device virtio-scsi-pci,id=scsi0,bus=pci.3,addr=0x1 \
-blockdev '{"driver":"file","filename":"/aarch64.raw","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \
-device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=libvirt-1-format,id=scsi0-0-0-0,bootindex=1 \
-device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,device_id=drive-scsi0-0-0-0,drive=libvirt-1-format,id=scsi0-0-0-0,bootindex=1 \
-netdev user,id=hostnet0 \
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:09:a4:37,bus=pci.3,addr=0x2 \
-netdev user,id=hostnet1 \

View File

@ -37,7 +37,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-usb \
-blockdev '{"driver":"file","filename":"/tmp/scsidisk.img","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \
-device scsi-hd,bus=scsi0.0,scsi-id=0,drive=libvirt-1-format,id=scsi0-0-0,bootindex=1 \
-device scsi-hd,bus=scsi0.0,scsi-id=0,device_id=drive-scsi0-0-0,drive=libvirt-1-format,id=scsi0-0-0,bootindex=1 \
-audiodev '{"id":"audio1","driver":"none"}' \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \
-msg timestamp=on

View File

@ -29,7 +29,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-usb \
-blockdev '{"driver":"file","filename":"/tmp/scsidisk.img","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \
-device scsi-hd,bus=scsi1.0,channel=0,scsi-id=0,lun=0,drive=libvirt-1-format,id=scsi1-0-0-0,bootindex=1 \
-device scsi-hd,bus=scsi1.0,channel=0,scsi-id=0,lun=0,device_id=drive-scsi1-0-0-0,drive=libvirt-1-format,id=scsi1-0-0-0,bootindex=1 \
-chardev pty,id=charserial0 \
-device spapr-vty,chardev=charserial0,id=serial0,reg=536870912 \
-chardev pty,id=charserial1 \

View File

@ -29,7 +29,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-usb \
-blockdev '{"driver":"file","filename":"/tmp/scsidisk.img","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \
-device scsi-hd,bus=scsi1.0,channel=0,scsi-id=0,lun=0,drive=libvirt-1-format,id=scsi1-0-0-0,bootindex=1 \
-device scsi-hd,bus=scsi1.0,channel=0,scsi-id=0,lun=0,device_id=drive-scsi1-0-0-0,drive=libvirt-1-format,id=scsi1-0-0-0,bootindex=1 \
-chardev pty,id=charserial0 \
-device spapr-vty,chardev=charserial0,id=serial0,reg=805306368 \
-chardev pty,id=charserial1 \

View File

@ -27,9 +27,9 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-redhat62sparc/.config \
-usb \
-blockdev '{"driver":"file","filename":"/home/berrange/VirtualMachines/redhat-6.2-sparc.img","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-2-format","read-only":false,"driver":"qcow2","file":"libvirt-2-storage"}' \
-device scsi-hd,bus=scsi.0,scsi-id=0,drive=libvirt-2-format,id=scsi0-0-0-0,bootindex=1 \
-device scsi-hd,bus=scsi.0,scsi-id=0,device_id=drive-scsi0-0-0-0,drive=libvirt-2-format,id=scsi0-0-0-0,bootindex=1 \
-blockdev '{"driver":"file","filename":"/home/berrange/VirtualMachines/redhat-6.2-sparc.iso","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-1-format","read-only":true,"driver":"raw","file":"libvirt-1-storage"}' \
-device scsi-cd,bus=scsi.0,scsi-id=1,drive=libvirt-1-format,id=scsi0-0-0-1 \
-device scsi-cd,bus=scsi.0,scsi-id=1,device_id=drive-scsi0-0-0-1,drive=libvirt-1-format,id=scsi0-0-0-1 \
-audiodev '{"id":"audio1","driver":"none"}' \
-msg timestamp=on