qemu: caps: Always assume presence of 'scsi-hd' and 'scsi-cd' device

The split of scsi-disk into the two separate devices was introduced by
qemu commit b443ae67 released in qemu v0.15.

All changes to test files are not really related to disk testing thanks
to previous refactors.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Peter Krempa 2019-01-28 14:29:10 +01:00
parent 12116c018d
commit 4bf49bc566
47 changed files with 24 additions and 73 deletions

View File

@ -1023,7 +1023,6 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
{ "qxl", QEMU_CAPS_DEVICE_QXL },
{ "sga", QEMU_CAPS_SGA },
{ "scsi-block", QEMU_CAPS_SCSI_BLOCK },
{ "scsi-cd", QEMU_CAPS_SCSI_CD },
{ "ide-cd", QEMU_CAPS_IDE_CD },
{ "VGA", QEMU_CAPS_DEVICE_VGA },
{ "cirrus-vga", QEMU_CAPS_DEVICE_CIRRUS_VGA },

View File

@ -174,7 +174,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
/* 90 */
X_QEMU_CAPS_BLOCKJOB_SYNC, /* old block_job_cancel, block_stream */
QEMU_CAPS_BLOCKJOB_ASYNC, /* new block-job-cancel, block-stream */
QEMU_CAPS_SCSI_CD, /* -device scsi-cd */
X_QEMU_CAPS_SCSI_CD, /* -device scsi-cd */
QEMU_CAPS_IDE_CD, /* -device ide-cd */
X_QEMU_CAPS_NO_USER_CONFIG, /* -no-user-config */

View File

@ -1762,13 +1762,10 @@ qemuBuildDriveStr(virDomainDiskDefPtr disk,
* legacy -drive is used. In modern qemu the 'ide-cd' or 'scsi-cd' are used.
* virtio and other just ignore the attribute anyways */
if (disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM) {
if (disk->bus == VIR_DOMAIN_DISK_BUS_SCSI) {
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_CD))
virBufferAddLit(&opt, ",media=cdrom");
} else if (disk->bus == VIR_DOMAIN_DISK_BUS_IDE) {
if (disk->bus == VIR_DOMAIN_DISK_BUS_IDE) {
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_IDE_CD))
virBufferAddLit(&opt, ",media=cdrom");
} else {
} else if (disk->bus != VIR_DOMAIN_DISK_BUS_SCSI) {
virBufferAddLit(&opt, ",media=cdrom");
}
}
@ -1995,14 +1992,10 @@ qemuBuildDiskDeviceStr(const virDomainDef *def,
if (disk->device == VIR_DOMAIN_DISK_DEVICE_LUN) {
virBufferAddLit(&opt, "scsi-block");
} else {
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_CD)) {
if (disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM)
virBufferAddLit(&opt, "scsi-cd");
else
virBufferAddLit(&opt, "scsi-hd");
} else {
virBufferAddLit(&opt, "scsi-disk");
}
if (disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM)
virBufferAddLit(&opt, "scsi-cd");
else
virBufferAddLit(&opt, "scsi-hd");
}
if (!(contAlias = virDomainControllerAliasFind(def, VIR_DOMAIN_CONTROLLER_TYPE_SCSI,

View File

@ -29,7 +29,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='ide-cd'/>
<flag name='hda-micro'/>
<flag name='dump-guest-memory'/>

View File

@ -29,7 +29,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='ide-cd'/>
<flag name='hda-micro'/>
<flag name='dump-guest-memory'/>

View File

@ -29,7 +29,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='ide-cd'/>
<flag name='hda-micro'/>
<flag name='dump-guest-memory'/>

View File

@ -29,7 +29,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='ide-cd'/>
<flag name='hda-micro'/>
<flag name='dump-guest-memory'/>

View File

@ -23,7 +23,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='ide-cd'/>
<flag name='hda-micro'/>
<flag name='dump-guest-memory'/>

View File

@ -22,7 +22,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='ide-cd'/>
<flag name='hda-micro'/>
<flag name='dump-guest-memory'/>

View File

@ -13,7 +13,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='dump-guest-memory'/>
<flag name='balloon-event'/>
<flag name='virtio-scsi-pci'/>

View File

@ -29,7 +29,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='ide-cd'/>
<flag name='hda-micro'/>
<flag name='dump-guest-memory'/>

View File

@ -13,7 +13,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='dump-guest-memory'/>
<flag name='balloon-event'/>
<flag name='virtio-scsi-pci'/>

View File

@ -29,7 +29,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='ide-cd'/>
<flag name='hda-micro'/>
<flag name='dump-guest-memory'/>

View File

@ -23,7 +23,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='ide-cd'/>
<flag name='hda-micro'/>
<flag name='dump-guest-memory'/>

View File

@ -22,7 +22,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='ide-cd'/>
<flag name='hda-micro'/>
<flag name='dump-guest-memory'/>

View File

@ -13,7 +13,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='dump-guest-memory'/>
<flag name='balloon-event'/>
<flag name='virtio-scsi-pci'/>

View File

@ -29,7 +29,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='ide-cd'/>
<flag name='hda-micro'/>
<flag name='dump-guest-memory'/>

View File

@ -29,7 +29,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='ide-cd'/>
<flag name='hda-micro'/>
<flag name='dump-guest-memory'/>

View File

@ -29,7 +29,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='ide-cd'/>
<flag name='hda-micro'/>
<flag name='dump-guest-memory'/>

View File

@ -25,7 +25,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='ide-cd'/>
<flag name='hda-micro'/>
<flag name='dump-guest-memory'/>

View File

@ -22,7 +22,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='ide-cd'/>
<flag name='hda-micro'/>
<flag name='dump-guest-memory'/>

View File

@ -29,7 +29,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='ide-cd'/>
<flag name='hda-micro'/>
<flag name='dump-guest-memory'/>

View File

@ -13,7 +13,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='dump-guest-memory'/>
<flag name='balloon-event'/>
<flag name='virtio-scsi-pci'/>

View File

@ -29,7 +29,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='ide-cd'/>
<flag name='hda-micro'/>
<flag name='dump-guest-memory'/>

View File

@ -13,7 +13,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='dump-guest-memory'/>
<flag name='balloon-event'/>
<flag name='virtio-scsi-pci'/>

View File

@ -29,7 +29,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='ide-cd'/>
<flag name='hda-micro'/>
<flag name='dump-guest-memory'/>

View File

@ -22,7 +22,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='ide-cd'/>
<flag name='hda-micro'/>
<flag name='dump-guest-memory'/>

View File

@ -13,7 +13,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='dump-guest-memory'/>
<flag name='balloon-event'/>
<flag name='virtio-scsi-pci'/>

View File

@ -29,7 +29,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='ide-cd'/>
<flag name='hda-micro'/>
<flag name='dump-guest-memory'/>

View File

@ -22,7 +22,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='ide-cd'/>
<flag name='hda-micro'/>
<flag name='dump-guest-memory'/>

View File

@ -7,7 +7,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='dump-guest-memory'/>
<flag name='balloon-event'/>
<flag name='virtio-scsi-pci'/>

View File

@ -7,7 +7,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='dump-guest-memory'/>
<flag name='balloon-event'/>
<flag name='virtio-scsi-pci'/>

View File

@ -14,7 +14,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='dump-guest-memory'/>
<flag name='balloon-event'/>
<flag name='virtio-scsi-pci'/>

View File

@ -29,7 +29,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='ide-cd'/>
<flag name='hda-micro'/>
<flag name='dump-guest-memory'/>

View File

@ -22,7 +22,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='ide-cd'/>
<flag name='hda-micro'/>
<flag name='dump-guest-memory'/>

View File

@ -29,7 +29,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='ide-cd'/>
<flag name='hda-micro'/>
<flag name='dump-guest-memory'/>

View File

@ -25,7 +25,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='ide-cd'/>
<flag name='hda-micro'/>
<flag name='dump-guest-memory'/>

View File

@ -25,7 +25,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='ide-cd'/>
<flag name='hda-micro'/>
<flag name='dump-guest-memory'/>

View File

@ -29,7 +29,6 @@
<flag name='scsi-block'/>
<flag name='transaction'/>
<flag name='block-job-async'/>
<flag name='scsi-cd'/>
<flag name='ide-cd'/>
<flag name='hda-micro'/>
<flag name='dump-guest-memory'/>

View File

@ -30,8 +30,8 @@ path=/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \
-device pci-bridge,chassis_nr=3,id=pci.3,bus=pci.1,addr=0x1 \
-device virtio-scsi-pci,id=scsi0,bus=pci.3,addr=0x1 \
-drive file=/aarch64.raw,format=raw,if=none,id=drive-scsi0-0-0-0 \
-device scsi-disk,bus=scsi0.0,channel=0,scsi-id=0,lun=0,\
drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1 \
-device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,\
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 \

View File

@ -29,6 +29,6 @@ server,nowait \
-device ioh3420,port=0x10,chassis=3,id=pci.3,bus=pcie.0,addr=0x2 \
-device virtio-scsi-pci,id=scsi0,bus=pci.2,addr=0x1 \
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-scsi0-0-0-0 \
-device scsi-disk,bus=scsi0.0,channel=0,scsi-id=0,lun=0,\
drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1 \
-device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,\
id=scsi0-0-0-0,bootindex=1 \
-device virtio-balloon-pci,id=balloon0,bus=pci.2,addr=0x2

View File

@ -25,6 +25,6 @@ server,nowait \
-device ioh3420,port=0x10,chassis=3,id=pci.3,bus=pcie.0,addr=0x2 \
-device virtio-scsi-pci,id=scsi0,bus=pci.2,addr=0x1 \
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-scsi0-0-0-0 \
-device scsi-disk,bus=scsi0.0,channel=0,scsi-id=0,lun=0,\
drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1 \
-device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,\
id=scsi0-0-0-0,bootindex=1 \
-device virtio-balloon-pci,id=balloon0,bus=pci.2,addr=0x2

View File

@ -31,6 +31,6 @@ server,nowait \
-device lsi,id=scsi8,bus=pci.0,addr=0x4.0x7 \
-usb \
-drive file=/tmp/scsidisk.img,format=raw,if=none,id=drive-scsi0-0-0 \
-device scsi-disk,bus=scsi0.0,scsi-id=0,drive=drive-scsi0-0-0,id=scsi0-0-0,\
-device scsi-hd,bus=scsi0.0,scsi-id=0,drive=drive-scsi0-0-0,id=scsi0-0-0,\
bootindex=1 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5

View File

@ -23,8 +23,8 @@ server,nowait \
-device spapr-vscsi,id=scsi1,reg=0x30000000 \
-usb \
-drive file=/tmp/scsidisk.img,format=raw,if=none,id=drive-scsi1-0-0-0 \
-device scsi-disk,bus=scsi1.0,channel=0,scsi-id=0,lun=0,\
drive=drive-scsi1-0-0-0,id=scsi1-0-0-0,bootindex=1 \
-device scsi-hd,bus=scsi1.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi1-0-0-0,\
id=scsi1-0-0-0,bootindex=1 \
-chardev pty,id=charserial0 \
-device spapr-vty,chardev=charserial0,id=serial0,reg=0x20000000 \
-chardev pty,id=charserial1 \

View File

@ -23,8 +23,8 @@ server,nowait \
-device spapr-vscsi,id=scsi1,reg=0x3000 \
-usb \
-drive file=/tmp/scsidisk.img,format=raw,if=none,id=drive-scsi1-0-0-0 \
-device scsi-disk,bus=scsi1.0,channel=0,scsi-id=0,lun=0,\
drive=drive-scsi1-0-0-0,id=scsi1-0-0-0,bootindex=1 \
-device scsi-hd,bus=scsi1.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi1-0-0-0,\
id=scsi1-0-0-0,bootindex=1 \
-chardev pty,id=charserial0 \
-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 \
-chardev pty,id=charserial1 \

View File

@ -1116,16 +1116,13 @@ mymain(void)
DO_TEST_CAPS_VER("disk-scsi-device-auto", "1.5.3");
DO_TEST_CAPS_LATEST("disk-scsi-device-auto");
DO_TEST("disk-scsi-disk-split",
QEMU_CAPS_SCSI_CD, QEMU_CAPS_SCSI_LSI, QEMU_CAPS_VIRTIO_SCSI);
QEMU_CAPS_SCSI_LSI, QEMU_CAPS_VIRTIO_SCSI);
DO_TEST("disk-scsi-disk-wwn",
QEMU_CAPS_SCSI_CD, QEMU_CAPS_SCSI_LSI, QEMU_CAPS_VIRTIO_SCSI,
QEMU_CAPS_SCSI_DISK_WWN);
QEMU_CAPS_SCSI_LSI, QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_SCSI_DISK_WWN);
DO_TEST("disk-scsi-disk-vpd",
QEMU_CAPS_SCSI_CD, QEMU_CAPS_SCSI_LSI, QEMU_CAPS_VIRTIO_SCSI,
QEMU_CAPS_SCSI_DISK_WWN);
QEMU_CAPS_SCSI_LSI, QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_SCSI_DISK_WWN);
DO_TEST_FAILURE("disk-scsi-disk-vpd-build-error",
QEMU_CAPS_SCSI_CD, QEMU_CAPS_SCSI_LSI, QEMU_CAPS_VIRTIO_SCSI,
QEMU_CAPS_SCSI_DISK_WWN);
QEMU_CAPS_SCSI_LSI, QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_SCSI_DISK_WWN);
DO_TEST_CAPS_LATEST("controller-virtio-scsi");
DO_TEST("disk-sata-device",
QEMU_CAPS_ICH9_AHCI);

View File

@ -557,11 +557,9 @@ mymain(void)
DO_TEST("numad-static-vcpu-no-numatune", NONE);
DO_TEST("disk-scsi-lun-passthrough-sgio",
QEMU_CAPS_SCSI_CD, QEMU_CAPS_SCSI_LSI,
QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_SCSI_DISK_WWN);
QEMU_CAPS_SCSI_LSI, QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_SCSI_DISK_WWN);
DO_TEST("disk-scsi-disk-vpd",
QEMU_CAPS_SCSI_CD, QEMU_CAPS_SCSI_LSI,
QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_SCSI_DISK_WWN);
QEMU_CAPS_SCSI_LSI, QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_SCSI_DISK_WWN);
DO_TEST("disk-source-pool", NONE);
DO_TEST("disk-source-pool-mode", NONE);