The 'device_id' property of 'scsi_disk' was added in qemu-4.0 and
it's
unconditionally present, thus we can now always assume it's presence.
Update some fake-caps test which didn't yet assert the capability.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_command.c | 12 +++++-------
.../aarch64-virtio-pci-manual-addresses.args | 2 +-
tests/qemuxml2argvdata/multifunction-pci-device.args | 2 +-
.../qemuxml2argvdata/pseries-vio-user-assigned.args | 2 +-
tests/qemuxml2argvdata/pseries-vio.args | 2 +-
tests/qemuxml2argvdata/sparc-minimal.args | 4 ++--
6 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 17aac57b03..cb54190780 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -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;
}
}
diff --git a/tests/qemuxml2argvdata/aarch64-virtio-pci-manual-addresses.args
b/tests/qemuxml2argvdata/aarch64-virtio-pci-manual-addresses.args
index 3000fea1a6..5242f680d2 100644
--- a/tests/qemuxml2argvdata/aarch64-virtio-pci-manual-addresses.args
+++ b/tests/qemuxml2argvdata/aarch64-virtio-pci-manual-addresses.args
@@ -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 \
diff --git a/tests/qemuxml2argvdata/multifunction-pci-device.args
b/tests/qemuxml2argvdata/multifunction-pci-device.args
index accb08bd33..2569c3ec71 100644
--- a/tests/qemuxml2argvdata/multifunction-pci-device.args
+++ b/tests/qemuxml2argvdata/multifunction-pci-device.args
@@ -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
diff --git a/tests/qemuxml2argvdata/pseries-vio-user-assigned.args
b/tests/qemuxml2argvdata/pseries-vio-user-assigned.args
index 5989b38a25..88ff276a4b 100644
--- a/tests/qemuxml2argvdata/pseries-vio-user-assigned.args
+++ b/tests/qemuxml2argvdata/pseries-vio-user-assigned.args
@@ -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 \
diff --git a/tests/qemuxml2argvdata/pseries-vio.args
b/tests/qemuxml2argvdata/pseries-vio.args
index 53277f2287..f83d891682 100644
--- a/tests/qemuxml2argvdata/pseries-vio.args
+++ b/tests/qemuxml2argvdata/pseries-vio.args
@@ -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 \
diff --git a/tests/qemuxml2argvdata/sparc-minimal.args
b/tests/qemuxml2argvdata/sparc-minimal.args
index a265a3ad38..63930f20c4 100644
--- a/tests/qemuxml2argvdata/sparc-minimal.args
+++ b/tests/qemuxml2argvdata/sparc-minimal.args
@@ -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
--
2.36.1